aboutsummaryrefslogtreecommitdiff
path: root/bgstack15-gallery-theme/static/js/app-with-media-page.js
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2021-02-01 09:07:23 -0500
committerB Stack <bgstack15@gmail.com>2021-02-01 09:07:23 -0500
commita4481dc007ff202882b783ed4b36e03a8b4c1d05 (patch)
tree0f8b5ccb6ea5e966e8d517b07936479ef49b3516 /bgstack15-gallery-theme/static/js/app-with-media-page.js
downloadgallery-a4481dc007ff202882b783ed4b36e03a8b4c1d05.tar.gz
gallery-a4481dc007ff202882b783ed4b36e03a8b4c1d05.tar.bz2
gallery-a4481dc007ff202882b783ed4b36e03a8b4c1d05.zip
initial commit
Diffstat (limited to 'bgstack15-gallery-theme/static/js/app-with-media-page.js')
-rw-r--r--bgstack15-gallery-theme/static/js/app-with-media-page.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/bgstack15-gallery-theme/static/js/app-with-media-page.js b/bgstack15-gallery-theme/static/js/app-with-media-page.js
new file mode 100644
index 0000000..8d01ccc
--- /dev/null
+++ b/bgstack15-gallery-theme/static/js/app-with-media-page.js
@@ -0,0 +1,39 @@
+$(".gallery").colorbox({
+ rel:"gallery",
+ transition:"none",
+ maxWidth: "90%",
+ maxHeight: "90%",
+ scalePhotos: true,
+ current: "{current} / {total}",
+ title: function () {
+ title = this.title;
+ if(this.hasAttribute("data-big")) {
+ title += " (full size)".link(this.getAttribute("data-big"));
+ }
+ if(this.hasAttribute("data-date")) {
+ title += this.getAttribute("data-date");
+ }
+ return title;
+ },
+ href: function () {
+ return this.getAttribute("data-href");
+ },
+ inline: function() {
+ return this.hasAttribute("inline");
+ }
+});
+
+$(document).bind('cbox_open', function(){
+ $("#cboxOverlay, #colorbox").swipe({
+ swipeLeft:function(event, direction, distance, duration, fingerCount) {
+ $.colorbox.next();
+ },
+ swipeRight:function(event, direction, distance, duration, fingerCount) {
+ $.colorbox.prev();
+ },
+ tap:function(event, target){
+ $.colorbox.close()
+ },
+ excludedElements: $.fn.swipe.defaults.excludedElements + ", #colorbox"
+ }).unbind("click");
+});
bgstack15