Skip to content

Instantly share code, notes, and snippets.

@Kasst1el
Last active January 31, 2017 17:45
Show Gist options
  • Save Kasst1el/a39edd8bd29bff380697bee60e1fe83b to your computer and use it in GitHub Desktop.
Save Kasst1el/a39edd8bd29bff380697bee60e1fe83b to your computer and use it in GitHub Desktop.
var stock_count = 2;
$(function(){
$(".wrap_gallery").swipe({
tap:function(){
$("#g_" + stock_count).css("opacity","0");
if(stock_count == 3){
stock_count = 0;
} else {
//////////
}
$("#g_" + (stock_count+1)).css("opacity","1");
stock_count++;
}
});
});
$("#stock_right").click(function(){
$("#g_" + stock_count).css("opacity","0");
if(stock_count == 3){
stock_count = 0;
}
$("#g_" + (stock_count+1)).css("opacity","1");
stock_count++;
});
$("#stock_left").click(function(){
$("#g_" + stock_count).css("opacity","0");
if(stock_count == 1){
stock_count = 4;
}
$("#g_" + (stock_count-1)).css("opacity","1");
stock_count--;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment