be-fe / iSlider

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

destroy方法的目的是? #256

Closed kiinlam closed 8 years ago

kiinlam commented 8 years ago

原型中destroy方法并不是清理得很干净,这个方法目的只是清除部分事件绑定吗? 还有些地方可以处理: 1、自动播放计时器; 2、调用bind时增加的事件监听; 3、一些dom的引用,如outer、wrap;

xieyu33333 commented 8 years ago

你说的对,之前有issue提到单页应用中可能需要destroy,但是后续在应用中很少遇到这种场景,所以destroy方法一直没有更新。

xieyu33333 commented 8 years ago

我们评估一下是完善destroy还是干脆移除它

shinate commented 8 years ago

重复实例化的场景很少,但还是保留吧,清理工作还得彻底一点

shinate commented 8 years ago

计时器与eventhandle清理已添加