您的位置:首页 > Web前端 > JQuery

基于Jquery实现苹果开关按钮特效的插件

2018-01-11 14:56 555 查看


默认使用

$.switch()


调整大小

$.switch({
target:'.biggerSwitch',
height:200
})


$.switch({
target:'.smallerSwitch',
height:50
})


开关事件的回调

$.switch({
target:'.callbackSwitch',
callback:function(that){
//return false  返回原始状态
if(that.attr('class').indexOf('on')){
//开启
}else{
//关闭
}
}
})


动画速度调整

$.switch({
target:'.speedSwitch',
speed:'slow',//'slow',
height:500
})


github地址:https://github.com/yetianyue/Jquery-switch

目前唯一的缺陷背景色,滑动状态还未结束就已经改变过来,待解决。有什么好的办法在评论中留言指正。

解决上述问题:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息