<script src='unlock.js'></script>
<link rel="stylesheet" type="text/css" href="unlock.css">
<div id = 'foo'></div>
var $container = $('#foo');
$container.slideToUnlock(options);
其中options为可选参数,有默认值 options参数列表
name | describe | default |
---|---|---|
width | width of the slider | width of container element |
height | height of the slider | height of container element |
bgColor | background color | #E8E8E8 |
progressColor | color of the progress bar | #FFE97F |
handleColor | color of the handler | #fff |
succColor | background color when successfully unlocked | #78D02E |
text | text on the progress bar | 'slide to unlock' |
textColor | color of text | #000 |
succText | text on the progress bar when successfully unlocked | 'ok!' |
succTextColor | color of succText | #000 |
succFunc | callback function when success | function() { alert('successfully
unlock!'); } |