be-fe / iSlider

Smooth mobile touch slider for Mobile WebApp, HTML5 App, Hybrid App
http://be-fe.github.io/iSlider/
MIT License
1.65k stars 449 forks source link

Bug: New两个iSlider对象,onslidechange有BUG #216

Closed Bellzzy closed 9 years ago

Bellzzy commented 9 years ago

任何一个对像移动时,都会影响onslidechange:

islider1 = new iSlider({ data: domlist, type:'dom', dom: document.getElementById("iSlider-show"), duration: 3000, animateType: 'default', isAutoplay: true, isLooping: true, onslideend: function(idx){ idx = idx +1; if(idx>=$("#iSlider-show li").size()){ idx =0; } $(".advtitle").html($("#iSlider-show img:eq("+idx+")").attr("alt")) }, onslidechange: function(idx){ idx = idx +1; if(idx>=$("#iSlider-show li").size()){ idx =0; } $(".advtitle").html($("#iSlider-show img:eq("+idx+")").attr("alt")) } });

islider2 = new iSlider({ data: domCate, type:'dom', dom: document.getElementById("iSlider-show-c"), duration: 3000, animateType: 'default', isAutoplay: false, isLooping: true });

如代码所示,操作islider2时,islider1的onslidechange也会有反映,也就是说onslidechange捕捉了两个对象的事件。

xieyu33333 commented 9 years ago

你可以在页面上把islider1和islider2这两个对象打印一下吗?

Bellzzy commented 9 years ago

目前项目中已经换别的方法,但还是很喜欢iSlider.