jQuery滑动解锁插件SlideUnlock

所属分类:-

 50592  298  查看评论 (8)
分享到微信朋友圈
X
jQuery滑动解锁插件SlideUnlock ie兼容11

html

<div class="slideunlock-wrapper">
    <input type="hidden" value="" class="slideunlock-lockable"/>
    <div class="slideunlock-slider">
        <span class="slideunlock-label"></span>
        <span class="slideunlock-lable-tip">Slide to unlock!</span>
    </div>
</div>

css

.slideunlock-wrapper{
    width: 360px;
    position: relative;
    padding: 50px;
    background: #ECF0F1;
    margin: 0 auto;
}
.slideunlock-slider{
    padding:20px;
    position: relative;
    border-radius: 2px;
    background-color: #FDEB9C;
    overflow: hidden;
    text-align: center;
}
.slideunlock-slider.success{
    background-color: #E5EE9F;
}
.slideunlock-label{
    width: 40px;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #E67E22;
    z-index: 999;
    border-radius: 2px;
    cursor: pointer;
}
.slideunlock-label-tip{
    z-index: 9;
}
@media screen and (max-width: 640px) {
    .slideunlock-wrapper{
        width: 64%;
    }
}

JavaScript

depend on jQuery

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.slideunlock.min.js"></script>
<script type="text/javascript">
    $(function () {
        var slider = new SliderUnlock(".slideunlock-slider", {
            labelTip: "滑动解锁",
            successLabelTip: "解锁成功",
            duration: 200   // 动画效果执行时间,默认200ms
        }, function(){
            alert('success');
        }, function(){
            $(".warn").text("index:" + slider.index + ", max:" + slider.max + ",lableIndex:" + slider.lableIndex + ",value:" + $(".slideunlock-lockable").val() + " date:" + new Date().getUTCDate());
        });
        slider.init();
        $("#reset-btn").on('click', function(){
            slider.reset();
        });
    })
</script>
var slider = new SliderUnlock(element, options, success, always);
slider.init();
// element is required and right. id or class or any identifying which can be loaded by jquery.
// if you dont want to give options, please give a null object, like this -- {}
If you need to support mobile,Please add jQuery mobile plugin:
<script type="text/javascript" src="js/jquery.mobile.min.js"></script>


相关插件-

扁平化设计Bootstrap3后台管理模板 Admin

扁平化设计Bootstrap3后台管理模板 Admin 整套网站
 
 45975  375

jQuery扔进垃圾桶效果

jQuery扔进垃圾桶效果
 
 26291  291

渐变动态动画

渐变地形动画,使用anime.js来制作动画
 
 23870  359

jquery横向纵向时间轴

demo1是纵向时间轴,demo2是横向的,
 
 44600  410

讨论这个项目(8)回答他人问题或分享插件使用方法奖励jQ币 评论用户自律公约

    爱死寂寞人 0
    2018/1/3 10:40:35

    拖动太快,会丢失

    回复
    My GD. 0
    2017/4/12 20:41:23

    怎么拖动了一次之后就不能脱了怎么写代码

    回复
    搁浅的脚印 0
    2016/11/20 11:11:03
    我老是改不了。。。不知道怎么改
        明无月0
        2017/2/4 15:06:10

        你看那依赖jQuery的版本介绍就知道怎么把中间的值改成中文的了

    回复
    搁浅的脚印 0
    2016/11/20 11:11:31
    怎么把中间的字改成中文版的额,,,我不要英文版的 回复
    Arron_yr 2
    2016/3/27 18:03:57
    关于样式需要说明一下,目前只是简单的颜色块,可根据自己的需求换为图片等等,都是自己写css就能搞定的事。 回复
    轻清波 0
    2016/3/27 13:03:01
    bug很严重。。。一定太快 会丢失,移动到头没有自动恢复
        Arron_yr0
        2016/3/27 18:03:38
        移动到头就是解锁成功了,怎么自动恢复。解锁成功之后有回调可以自己做其他的定义。移动太快会导致焦点丢失,这个会不断修复,更新之后会在评论中写明
    回复
😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
取消回复