From a4481dc007ff202882b783ed4b36e03a8b4c1d05 Mon Sep 17 00:00:00 2001 From: B Stack Date: Mon, 1 Feb 2021 09:07:23 -0500 Subject: initial commit --- .../static/js/app-with-media-page.js | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 bgstack15-gallery-theme/static/js/app-with-media-page.js (limited to 'bgstack15-gallery-theme/static/js/app-with-media-page.js') 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"); +}); -- cgit