Skip to content

Instantly share code, notes, and snippets.

@db-roberto
Created April 20, 2017 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save db-roberto/5b2b4e4f87ca08b2a86eeb3443933ba9 to your computer and use it in GitHub Desktop.
Save db-roberto/5b2b4e4f87ca08b2a86eeb3443933ba9 to your computer and use it in GitHub Desktop.
function(e, t, n) {
"use strict";
NB.Liquid.PageFeature = function() {
this.init()
}
,
NB.Liquid.PageFeature.prototype = {
$featureSlidesContainer: null,
init: function() {
this.$featureSlidesContainer = e("#feature-slides"),
this.render()
},
render: function() {
this.$featureSlidesContainer.length && this.$featureSlidesContainer.flexslider({
prevText: "",
nextText: "",
smoothHeight: !0,
animation: "slide",
start: function() {
var t = this.$featureSlidesContainer.find(".slides")
, n = this.$featureSlidesContainer.find(".flex-viewport")
, r = n.width()
, i = n.find(".slides > li").eq(1)
, s = i.find("img").attr("height")
, o = i.find("img").attr("width");
e("#page-features").css("max-height", "none"),
t.css("visibility", "visible"),
this.preventLinkClicksOnSwipe(t),
this.$featureSlidesContainer.find(".slider-loading").hide(),
n.height(r * s / o)
}
.bind(this)
})
},
preventLinkClicksOnSwipe: function(e) {
e.find("a").on("swipe", function(e) {
e.preventDefault(),
e.stopImmediatePropagation()
})
}
}
}(jQuery, document),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment