aboutsummaryrefslogtreecommitdiff
path: root/bgstack15-gallery-theme/static/js/app.js
blob: 7233fa16894761fd4933102d0d3ec6f0b02a3ef9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$(".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;
  },
  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