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

部分事件无法用`on`绑定 #376

Closed iulo closed 8 years ago

iulo commented 8 years ago

initialize initialized rendercomplete这些事件实际无法用on绑定,必须配置在options里

shinate commented 8 years ago

是的... 这些为实例化过程调用,必须在参数里配置。 会在文档中更新一下,谢谢反馈

iulo commented 8 years ago

还有命名能不能整理下,即使是在opts里面配置,onRenderComplete驼峰式还是更便于书写,看起来也舒服。 对于iSlide构造函数,首字母大写是不是更好些

shinate commented 8 years ago

因为很早的版本一直在使用全小写... 所以,也算是妥协了,确实很想统一的

iulo commented 8 years ago

考虑加个无new化处理?

var iSlider = function () {

    if (!(this instanceof iSlider)) {
        return new iSlider(arguments)
    }
    // ...
}
shinate commented 8 years ago

会改变以往用户的习惯... 考虑过,其实没什么差别╮(╯_╰)╭,而且做多实例的时候加个new区分方便些

shinate commented 8 years ago

2.1.8 命名已经可以使用驼峰,可以与全部小写并存,同时存在时取驼峰的

iulo commented 8 years ago

这个好 <( ̄︶ ̄)>