{"id":1733,"date":"2017-08-07T11:33:58","date_gmt":"2017-08-07T03:33:58","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=1733"},"modified":"2017-08-07T11:33:58","modified_gmt":"2017-08-07T03:33:58","slug":"jquery%e6%bb%91%e5%8a%a8%e8%a7%a3%e9%94%81%e6%8f%92%e4%bb%b6unlock-js%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=1733","title":{"rendered":"jQuery\u6ed1\u52a8\u89e3\u9501\u63d2\u4ef6unlock.js\u4f7f\u7528\u8be6\u89e3"},"content":{"rendered":"<p>\n\t\u6700\u8fd1\u6211\u5728github\u4e0a\u770b\u5230\u4e86\u4e00\u6b3e<a href=\"https:\/\/github.com\/menthe\/unlock.js\" name=\"unlock.js\" target=\"_blank\" title=\"unlock.js\">\u6ed1\u52a8\u89e3\u9501\u63d2\u4ef6unlock.js<\/a>\uff0c\u5728\u79fb\u52a8\u7aef\u4e0a\u7684\u8868\u73b0\u975e\u5e38\u4e0d\u9519\uff0c\u56e0\u6b64\u6211\u4e0b\u8f7d\u4e86\u5b83\u7684\u6e90\u7801\uff0c\u8fdb\u884c\u4e86\u5b66\u4e60\u3002\u672c\u6587\u5c06\u7ed3\u5408\u6211\u4e2a\u4eba\u7684\u4f7f\u7528\u6574\u7406\u5b83\u7684\u4e00\u4e9b\u7528\u6cd5\u3002\n<\/p>\n<p>\n\tunlock.js\u662f\u4e00\u6b3ejQuery\u6ed1\u52a8\u89e3\u9501\u63d2\u4ef6\u3002\u76ee\u524d\u5f88\u591a\u7f51\u7ad9\u5728\u7528\u6237\u767b\u5f55\u548c\u6ce8\u518c\u65f6\uff0c\u4e3a\u9632\u6b62\u6076\u610f\u653b\u51fb\uff0c\u91c7\u7528\u6765\u6ed1\u52a8\u89e3\u9501\u7684\u9a8c\u8bc1\u65b9\u5f0f\u3002\u7528\u6237\u9700\u8981\u6ed1\u52a8\u6307\u5b9a\u7684\u6ed1\u5757\u5230\u6307\u5b9a\u4f4d\u7f6e\uff0c\u624d\u80fd\u901a\u8fc7\u9a8c\u8bc1\u3002unlock.js\u53ef\u4ee5\u5b9e\u73b0\u8fd9\u79cd\u6ed1\u52a8\u89e3\u9501\u529f\u80fd\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\u6ed1\u52a8\u89e3\u9501unlock.js\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/20170807001.jpg\" style=\"width: 416px;height: 343px\" \/>\n<\/p>\n<p>\n\t\u4e0a\u56fe\u5c31\u662funlock.js\u89e3\u9501\u63d2\u4ef6\u7684\u4e00\u4e2a\u4f7f\u7528\u6848\u4f8b\u3002\n<\/p>\n<h2>\n\tunlock.js\u63d2\u4ef6\u7684\u7279\u70b9<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t\u6ed1\u52a8\u89e3\u9501\u3002\n\t<\/li>\n<li>\n\t\t\u5c3a\u5bf8\u3001\u989c\u8272\u3001\u5b57\u4f53\u5927\u5c0f\u7b49\u90fd\u53ef\u4ee5\u4e2a\u6027\u5316\u5b9a\u5236\u3002\n\t<\/li>\n<li>\n\t\t\u5b8c\u6210\u89e3\u9501\u540e\u4f1a\u6709\u56de\u8c03\u51fd\u6570\uff0c\u7528\u6765\u89e6\u53d1\u8fdb\u4e00\u6b65\u7684\u6570\u636e\u5904\u7406\u3002\n\t<\/li>\n<\/ul>\n<h2>\n\tunlock.js\u5b89\u88c5\u4f7f\u7528<br \/>\n<\/h2>\n<p>\n\t\u6839\u636eunlock.js\u63d0\u4f9b\u7684\u6848\u4f8b<a href=\"https:\/\/github.com\/menthe\/unlock.js\/blob\/master\/examples\/index.html\" name=\"unlock.js\" target=\"_blank\" title=\"unlock.js\">examples<\/a>\uff0c\u6211\u603b\u4e86\u4e00\u4e0b\u5b83\u7684\u4f7f\u7528\u65b9\u6cd5\u3002\n<\/p>\n<p>\n\t\u9996\u5148\u5728\u9875\u9762\u4e2d\u5f15\u5165unlock.css\u548cunlock.js\u6587\u4ef6\u3002\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;link href=&quot;css\/unlock.css&quot; rel=&quot;stylesheet&quot;&gt; \r\n&lt;script src=&#039;js\/unlock.js&#039;&gt;&lt;\/script&gt;<\/pre>\n<p>\n\t\u63a5\u4e0b\u6765\u5b9e\u73b0HTML\u7684\u7ed3\u6784\uff0c\u4f7f\u7528\u4e00\u4e2a&lt;div&gt;\u4f5c\u4e3a\u6ed1\u5757\u7684\u5bb9\u5668\u3002\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;!--\u6ed1\u5757\u5bb9\u5668--&gt; \r\n&lt;div id = &quot;xttblog&quot;&gt;&lt;\/div&gt;<\/pre>\n<p>\n\t\u6700\u540e\u6211\u4eec\u9700\u8981\u5728\u9875\u9762DOM\u5143\u7d20\u52a0\u8f7d\u5b8c\u6bd5\u4e4b\u540e\u521d\u59cb\u5316\u8be5\u6ed1\u52a8\u89e3\u9501\u63d2\u4ef6\u3002\n<\/p>\n<pre class=\"brush:jscript;\">\r\nvar $container = $(&#039;#xttblog&#039;); \r\n$container.slideToUnlock(options); <\/pre>\n<h2>\n\tunlock.js\u914d\u7f6e\u53c2\u6570<br \/>\n<\/h2>\n<p>\n\t\u5728\u4e0a\u9762\u521d\u59cb\u5316unlock.js\u6ed1\u52a8\u89e3\u9501\u63d2\u4ef6\u7684\u65f6\u5019\uff0c\u9700\u8981\u6211\u4eec\u4f20\u5165\u4e00\u4e2a\u53c2\u6570\uff0c\u8be5\u53c2\u6570\u7684\u914d\u7f6e\u7528\u6cd5\u5982\u4e0b\uff1a\n<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<thead>\n<tr>\n<td>\n\t\t\t\t\u53c2\u6570\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u9ed8\u8ba4\u503c\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u63cf\u8ff0\n\t\t\t<\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n\t\t\t\twidth\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u9ed8\u8ba4\u4e3a\u5bb9\u5668\u7684\u5bbd\u5ea6\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6ed1\u5757\u7684\u5bbd\u5ea6\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\theight\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u9ed8\u8ba4\u4e3a\u5bb9\u5668\u7684\u9ad8\u5ea6\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6ed1\u5757\u7684\u9ad8\u5ea6\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tbgColor\n\t\t\t<\/td>\n<td>\n\t\t\t\t#E8E8E8\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6ed1\u5757\u7684\u80cc\u666f\u989c\u8272\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tprogressColor\n\t\t\t<\/td>\n<td>\n\t\t\t\t#FFE97F\n\t\t\t<\/td>\n<td>\n\t\t\t\tprogress\u7684\u989c\u8272\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\thandleColor\n\t\t\t<\/td>\n<td>\n\t\t\t\t#fff\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6ed1\u5757\u624b\u67c4\u7684\u989c\u8272\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tsuccColor\n\t\t\t<\/td>\n<td>\n\t\t\t\t#78D02E\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6210\u529f\u89e3\u9501\u540e\u7684\u989c\u8272\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\ttext\n\t\t\t<\/td>\n<td>\n\t\t\t\t&#039;slide to unlock&#039;\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6ed1\u5757\u4e0a\u7684\u9ed8\u8ba4\u6587\u5b57\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\ttextColor\n\t\t\t<\/td>\n<td>\n\t\t\t\t#000\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6587\u5b57\u7684\u989c\u8272\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tsuccText\n\t\t\t<\/td>\n<td>\n\t\t\t\t&#039;ok!&#039;\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6210\u529f\u89e3\u9501\u540e\u663e\u793a\u7684\u6587\u5b57\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tsuccTextColor\n\t\t\t<\/td>\n<td>\n\t\t\t\t#000\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6210\u529f\u89e3\u9501\u540e\u663e\u793a\u7684\u6587\u5b57\u989c\u8272\n\t\t\t<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tsuccFunc\n\t\t\t<\/td>\n<td>\n\t\t\t\tfunction() { alert(&#039;successfully unlock!&#039;); }\n\t\t\t<\/td>\n<td>\n\t\t\t\t\u6210\u529f\u89e3\u9501\u540e\u7684\u56de\u8c03\u51fd\u6570\n\t\t\t<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=1733\">jQuery\u6ed1\u52a8\u89e3\u9501\u63d2\u4ef6unlock.js\u4f7f\u7528\u8be6\u89e3<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u6211\u5728github\u4e0a\u770b\u5230\u4e86\u4e00\u6b3e\u6ed1\u52a8\u89e3\u9501\u63d2\u4ef6unlock.js\uff0c\u5728\u79fb\u52a8\u7aef\u4e0a\u7684\u8868\u73b0\u975e\u5e38\u4e0d\u9519\uff0c\u56e0\u6b64\u6211\u4e0b\u8f7d\u4e86\u5b83\u7684\u6e90\u7801 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[878,49,1274,1409,880],"class_list":["post-1733","post","type-post","status-publish","format-standard","hentry","category-html5","tag-html5","tag-jquery","tag-unlock-js","tag-880"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1733"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1733\/revisions"}],"predecessor-version":[{"id":1734,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1733\/revisions\/1734"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}