$(document).ready(function() { $("#touchSlider").touchSlider({ flexible : true, view : 2, initComplete : function (e) { $("#touchSlider_paging").html(""); var num = 1; $("#touchSlider ul li").each(function (i, el) { if((i+1) % e._view == 0) { $("#touchSlider_paging").append(''); } }); $("#touchSlider_paging .btn_page").bind("click", function (e) { var i = $(this).index(); $("#touchSlider").get(0).go_page(i); }); }, counter : function (e) { $("#touchSlider_paging .btn_page").removeClass("on").eq(e.current-1).addClass("on"); } }); /*$("#touchSlider2").touchSlider({ flexible : true, btn_prev : $("#touchSlider2").next().find(".btn_prev"), btn_next : $("#touchSlider2").next().find(".btn_next"), counter : function (e) { $("#count").html("current : " + e.current + ", total : " + e.total); } });*/ $("#touchSlider2").touchSlider({ flexible : true, auto_slide : 1, auto_slide_time : 3, btn_prev : $("#touchSlider2").next().find(".btn_prev"), btn_next : $("#touchSlider2").next().find(".btn_next"), btn_start : $("#touchSlider2").next().find(".btn_start"), btn_stop : $("#touchSlider2").next().find(".btn_stop"), counter : function (e) { $("#count").html("current : " + e.current + ", total : " + e.total); } }); });