Skip to content

Instantly share code, notes, and snippets.

@sorrycc
Created February 11, 2014 07:46
Show Gist options
  • Save sorrycc/8930711 to your computer and use it in GitHub Desktop.
Save sorrycc/8930711 to your computer and use it in GitHub Desktop.
initHotProduct:function() {
$("div.J_Product").each(function() {
var el = this;
var swipe = Swipe(el, {
auto: 30000,
callback: function(pos) {
bullets.removeClass("on");
bullets[pos].className = "on";
}
});
var liEls = $(el).prev().find("li");
liEls.on("click", function(e) {
liEls.removeClass("on");
$(e.currentTarget).addClass("on");
var index = liEls.indexOf(e.currentTarget);
swipe.slide(index, 200);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment