<script type="text/javascript" src="js/jquery.min.js"></script> <scripttype="text/javascript"src="js/jquery.slideunlock.min.js"></script> <scripttype="text/javascript"> $(function () { var slider = newSliderUnlock(".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:" + newDate().getUTCDate()); }); slider.init(); $("#reset-btn").on('click', function(){ slider.reset(); }); }) </script> var slider = newSliderUnlock(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: <scripttype="text/javascript"src="js/jquery.mobile.min.js"></script>