{"id":3505,"date":"2013-07-17T09:06:30","date_gmt":"2013-07-17T01:06:30","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=3505"},"modified":"2018-01-02T03:14:54","modified_gmt":"2018-01-01T19:14:54","slug":"mobile-pad%e8%87%aa%e5%ae%9a%e4%b9%89%e6%bb%9a%e5%8a%a8%e6%8f%92%e4%bb%b6simpscroller","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2013\/07\/mobile-pad%e8%87%aa%e5%ae%9a%e4%b9%89%e6%bb%9a%e5%8a%a8%e6%8f%92%e4%bb%b6simpscroller\/","title":{"rendered":"\u5c0ftip: mobile\/pad\u81ea\u5b9a\u4e49\u6eda\u52a8\u8d85\u5c0f\u63d2\u4ef6simpScroller"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a><br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=3505\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=3505<\/a><\/p>\n<h3>\u4e00\u3001\u5c31\u662f\u4e2a\u5c0f\u63d2\u4ef6\uff0c\u5c31\u662f\u770b\u4e0d\u60ef\u5927\u63d2\u4ef6<\/h3>\n<p>\u9488\u5bf9\u79fb\u52a8\u8bbe\u5907\u7684\u81ea\u5b9a\u4e49\u6eda\u52a8\u6761\u63d2\u4ef6\u6709\u4e0d\u5c11\uff0c\u4f8b\u5982<a href=\"http:\/\/cubiq.org\/iscroll-4\">iscroll<\/a>, \u6216\u8005appframeword(\u539f\u540djqmobi)\u7684<code>af.scroller.js<\/code>\u65b9\u6cd5\u3002<\/p>\n<p>\u524d\u8005<code>34K<\/code>\uff0c\u540e\u8005\u5462\uff0c\u6211\u52d2\u4e2a\u53bb\uff0c<code>63K<\/code>! \u6ca1\u9519\uff0c<code>63K<\/code>!\u4e00\u4e2a\u6eda\u52a8\u63d2\u4ef6<code>63K<\/code>, \u800c\u4e14\u662f\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u4f7f\u7528\u7684\uff0c\u79fb\u52a8\u8054\u901a\u7acb\u5373\u8868\u793a\u538b\u529b\u5f88\u5927\uff01<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/106.gif\" align=\"absmiddle\"> \u4eba\u5bb6&#8230;\u4eba\u5bb6..\u53ea\u662f\u4e2a\u5c0f\u9879\u76ee\uff0c\u5c31\u6307\u5934\u591a\u4e2aweb app\u9875\u9762\uff0c\u4f60&#8230;\u4f60..\u7a81\u7136\u9732\u51fa\u4e00\u8eab\u808c\u8089\uff0c\u4eba\u5bb6\u6015\u6015\u2026\u2026<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201307\/jirounan.jpg\" width=\"298\" height=\"206\" alt=\"\u808c\u8089\u7537\" class=\"alignnone\" \/> <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201307\/shoujing.jpg\" width=\"100\" height=\"100\" alt=\"\u53d7\u60ca\" class=\"alignnone\" \/><\/p>\n<p>\u4e3a\u4e86\u5b89\u629a\u53d7\u4f24\u7684\u5c0f\u5fc3\u7075\uff0c<code>simpScroller<\/code>\u6a2a\u5730\u51fa\u4e16\u3002\u4e25\u683c\u610f\u4e49\u4e0a\u5c06\uff0c<code>simpScroller<\/code>\u5c31\u662f\u4e2a\u65b9\u6cd5\uff0c\u7b97\u4e0d\u4e0a\u63d2\u4ef6\uff0c\u4f46\u662f\uff0c\u4e3a\u4e86\u6390\u4f4f\u201c\u63d2\u4ef6\u201d\u8fd9\u4e2a\u5173\u952e\u5b57\uff0c\u5c31\u539a\u8138\u76ae\u8e6d\u4eb2\u621a\u4e86\u3002<\/p>\n<p>\u7c7b\u4f3c<code>iscroll<\/code>\u8fd9\u6837\u7684\u63d2\u4ef6\uff0c\u4e3a\u4e86\u5168\u65b9\u4f4d\u6a21\u62df\u539f\u751f\u8bbe\u5907\u7684scroll\u7f13\u52a8\u3001\u5239\u8f66\u4ee5\u53ca\u56de\u5f39\u6548\u679c\u7b49\uff0c\u56e0\u6b64\uff0c\u6298\u817e\u4e86\u5f88\u591a\u7684\u76f8\u5173\u4ee3\u7801\uff0c\u4e8e\u662f\uff0c\u6587\u4ef6\u7684\u5927\u5c0f\u5c31\u8e6d\u8e6d\u8e6d\u4e0a\u53bb\u4e86\u3002<\/p>\n<p><code>simpScroller<\/code>\u629b\u5f03\u4e86\u8fd9\u4e9b\u70ab\u70ab\u7684UI\uff0c\u8fd8\u6709\u5176\u4ed6\u6742\u4e03\u6742\u516b\u590d\u6742\u7684\u529f\u80fd\uff0c\u5c31\u4e13\u6ce8\u4e8e\u81ea\u5b9a\u4e49\u6eda\u52a8\u3002\u76ee\u524d\u5176\u5c3a\u5bf8\u5c0f\u4e8e<code>5K<\/code>, \u538b\u7f29\u540e\u5c0f\u4e8e<code>2K<\/code>. \u800c\u4e14\uff0c\u5b9e\u9645\u4e0a\uff0c\u5982\u679c\u4e0d\u8981\u5173\u5fc3\u684c\u9762\u8bbe\u5907\u4ee5\u53ca\u53cc\u5411\u6eda\u52a8\uff0c\u4f53\u79ef\u8fd8\u53ef\u4ee5\u5c0f<code>20%<\/code>\u5de6\u53f3\u3002<\/p>\n<h3>\u4e8c\u3001\u662f\u808c\u8089\u7537\u8fd8\u662f\u6392\u9aa8\u7537\uff0c\u62c9\u51fa\u6765\u6e9c\u6e9c<\/h3>\n<p>\u5982\u679c\u60a8\u6709\u624b\u673a\uff0c\u6b22\u8fce\u5e2e\u5fd9\u4f17\u6d4b\u4e00\u4e0b\uff0c\u9700\u8981\u8f93\u5165\u4e0b\u9762\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/GitHub\/simpScroller\/\">http:\/\/www.zhangxinxu.com\/GitHub\/simpScroller\/<\/a> \u6ce8\u610f\u533a\u5206\u5927\u5c0f\u5199\u3002<br \/>\n\u6216\u8005\u626b\u63cf\u4e0b\u9762\u7684\u4e8c\u7ef4\u7801\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201307\/qrcode.png\" width=\"198\" height=\"198\" alt=\"\u6d4b\u8bd5\u7f51\u5740\u4e8c\u7ef4\u7801\" class=\"mt10\" \/><\/p>\n<p>\u76ee\u524d\u9875\u9762\u603b\u5927\u5c0f<code>21.3K<\/code> &#8211; \u5176\u4e2d\u5f20\u542b\u97f5MM\u56fe\u7247\u5360\u4e86<code>14K<\/code>\u591a~.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201307\/2013-07-16_180330.png\" width=\"390\" height=\"171\" alt=\"\u6548\u679c\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p><strong>\u8bf4\u660e\uff1a<\/strong><br \/>\nAndroid 4\u7248\u672c\u6d4f\u89c8\u5668\u4e0b\uff0c\u8c8c\u4f3c\u5143\u7d20\u5bbd\u5ea6\u8bbe\u7f6e\u8d85\u8fc7\u5c4f\u5e55\uff0c\u5176\u5ffd\u7565\u4e86\u3002\u56e0\u6b64\uff0c\u6587\u5b57\u7248\u6c34\u5e73\u6eda\u52a8\u6548\u679c\u53ef\u80fd\u6ca1\u6709\uff08\u6307\u4e0a\u9762FF\u622a\u56fe\u5bf9\u5e94\u7684\u5185\u5bb9\uff09\uff0c\u5c4f\u5e55\u6a2a\u8fc7\u6765\u6548\u679c\u53ef\u89c1\u3002<\/p>\n<h3>\u4e09\u3001simpScroller\u5728github<\/h3>\n<p><code>simpScroller<\/code>\u6211\u5df2\u7ecf\u5f00\u6e90\u5230github\u4e0a\u4e86\uff0c\u6b22\u8fcefork me. \u5730\u5740\u662f\uff1a<a href=\"https:\/\/github.com\/zhangxinxu\/simpScroller\">https:\/\/github.com\/zhangxinxu\/simpScroller<\/a><\/p>\n<p>\u6700\u65b0\u7684JS\/CSS\u6587\u4ef6\u5c31\u53bbgithub\u4e0a\u4e0b\u8f7d\uff0c\u6b63\u597d\u7701\u4e86\u4e0d\u5c11\u66f4\u65b0\u6210\u672c\u3002\u9879\u76ee\u9875\u9762\u53f3\u4e0b\u67d0\u4f4d\u7f6e\u6709zip\u6253\u5305\u6587\u4ef6\u4e0b\u8f7d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201307\/2013-07-17_085936.png\" width=\"427\" height=\"315\" alt=\"github\u4e0a\u7684\u6253\u5305\u4e0b\u8f7d\u793a\u610f \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" \/><\/p>\n<h3>\u56db\u3001\u6d4f\u89c8\u5668\u652f\u6301<\/h3>\n<p>\u5e38\u89c1\u624b\u673a\u6d4f\u89c8\u5668\uff0c\u5305\u62ecAndroid2.*\u7248\u672c\u3002\u684c\u9762\u6d4f\u89c8\u5668IE9+\u4ee5\u53ca\u5176\u4ed6\u73b0\u4ee3\u6d4f\u89c8\u5668\u90fd\u53ef\u4ee5\u67e5\u770b\u3001\u8f85\u52a9\u8c03\u8bd5\u3002<\/p>\n<p>\u4e0d\u8fc7\uff0cAndroid\u7684\u673a\u578b\u5343\u5343\u4e07\u4e07\uff0c\u4e0d\u4fdd\u8bc1\u6240\u6709\u6d4f\u89c8\u5668\u90fd\u4e0d\u62bd\u98ce\u3002<\/p>\n<h3>\u4e94\u3001\u57fa\u672c\u4f7f\u7528\u4ee5\u53caAPIs<\/h3>\n<p><code>simpScroller<\/code>\u65b9\u6cd5<strong>\u4e0d\u4f9d\u8d56<\/strong>\u4efb\u4f55JavaScript\u6846\u67b6\uff0c\u51e0\u4e4e\u65e0\u51b2\u7a81\u53ef\u80fd\uff0c\u53ef\u653e\u5fc3\u4f7f\u7528\u3002<\/p>\n<div class=\"zxx_code\">\n<pre>simpScroller(container, options);<\/pre>\n<\/div>\n<p><code>container<\/code>\u8868\u793a\u9700\u8981\u6eda\u52a8\u7684\u5bb9\u5668\uff0c\u5982\u679c\u5782\u76f4\u6eda\u52a8\uff0c\u8981\u5b9a\u9ad8\u3002<code>options<\/code>\u4e3a\u53ef\u9009\u53c2\u6570\uff0c\u5177\u4f53\u89c1\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>{\n    verticalScroll: true,          \/\/ \u9ed8\u8ba4\u5782\u76f4\u6eda\u52a8\n    horizontalScroll: false,       \/\/ \u6c34\u5e73\u6eda\u52a8\uff0c\u9ed8\u8ba4false\uff0c\u4e0d\u6c34\u5e73\u6eda\u52a8\n    hideScrollBar: false,          \/\/ \u662f\u5426\u9690\u85cf\u6eda\u52a8\u6761\n    onScroll: function() {}        \/\/ \u6eda\u52a8\u65f6\u5019\u7684\u56de\u8c03\n                                   \/\/ \u652f\u6301\u4e00\u4e2a\u53c2\u6570\uff0c\u4e3aevent\u5bf9\u8c61 \n}<\/pre>\n<\/div>\n<p>\u6eda\u52a8\u6761\u7684UI\u653e\u5728\u5916\u90e8CSS\u4e2d\u4e86\uff0c\u65b9\u4fbf\u63a7\u5236\uff0c\u5168\u90e8CSS\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>.scroller_vertical,\n.scroller_horizontal {\t\n    border-radius: 2.5px;\n    background-color: rgba(0,0,0,.35);\n    -webkit-transition: opacity .5s;\n            transition: opacity .5s;\n    position: absolute;\n    opacity: 0;\n}\n.scroller_vertical {\n    width: 5px;\n    right: 0;\n}\n.scroller_horizontal {\n    height: 5px;\n    bottom: 0;\n}<\/pre>\n<\/div>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u81ea\u5b9a\u4e49\u6eda\u52a8\u6761\u7684\u6e10\u9690\u6e10\u73b0\u662f<code>transition<\/code>\u8fc7\u6e21\u6548\u679c\u5b9e\u73b0\u7684\uff0c\u60a8\u53ef\u4ee5\u8c03\u6574\u53d8\u5316\u7684\u5468\u671f\u65f6\u95f4\u3002<\/p>\n<p>\u8ddf\u5f00\u6e90\u7684\u8457\u540d\u7684\u5927\u7684\u6eda\u52a8\u63d2\u4ef6\u4e0d\u540c\uff0c\u8fd9\u91cc\u81ea\u5b9a\u4e49\u6eda\u52a8\u6761\u7684\u5b9a\u4f4d\u5c31\u662fCSS2.1\u4e2d\u7684<code>top<\/code>\/<code>left<\/code>\u5c5e\u6027\uff0c\u800c\u4e0d\u662f3D <code>animation<\/code>. \u5143\u7d20\u7684\u6eda\u52a8\u5c31\u662f\u5143\u7d20\u672c\u8eab\u7684<code>scroll<\/code>\u6eda\u52a8\u3002<\/p>\n<h3>\u516d\u3001\u5df2\u77e5\u95ee\u9898<\/h3>\n<p>\u4e3a\u4e86\u8ba9\u53cc\u5411\u6eda\u52a8\u7684\u65f6\u5019\u4e0d\u540c\u65b9\u5411\u6eda\u52a8\u6761\u9759\u6b62\uff0c\u56e0\u6b64\uff0c\u4f1a\u5728\u6eda\u52a8\u5bb9\u5668\u5185\u90e8\u518d\u5d4c\u5957\u4e00\u5c42<code>div<\/code>\uff0c\u8fd9\u5c31\u53ef\u80fd\u5bfc\u81f4\u4e86\u7c7b\u4f3c<code>.container > p<\/code>\u8fd9\u6837\u7684\u76f8\u90bb\u7956\u5148\u9009\u62e9\u5668\u5931\u6548\u3002<\/p>\n<h3>\u4e03\u3001\u7ed3\u8bed<\/h3>\n<p>\u60f3\u6cd5\u867d\u597d\uff0c\u95ee\u9898\u4f30\u8ba1\u4e0d\u5c11\u3002\u6b22\u8fce\u4f17\u6d4b\uff0c\u5982\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u53ef\u4ee5\u5728github\u4e0a\u8fd9\u4e2a\u5730\u5740\u4e2d\u53cd\u9988<a href=\"https:\/\/github.com\/zhangxinxu\/simpScroller\/issues\">https:\/\/github.com\/zhangxinxu\/simpScroller\/issues<\/a>, \u4e0d\u751a\u611f\u8c22\u3002<\/p>\n<p>\u6709\u66f4\u91cd\u8981\u7684\u4e8b\u60c5\uff0c\u5c31\u4e0d\u5410\u69fd\u4e86\uff01<\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u6765\u81ea<a href=\"http:\/\/www.zhangxinxu.com\/\">\u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b<\/a>[<a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a>]<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=3505\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=3505<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9488\u5bf9\u79fb\u52a8\u8bbe\u5907\u7684\u81ea\u5b9a\u4e49\u6eda\u52a8\u6761\u63d2\u4ef6\u6709\u4e0d\u5c11\uff0c\u4f8b\u5982<a href=\"http:\/\/cubiq.org\/iscroll-4\">iscroll<\/a>, \u6216\u8005appframeword(\u539f\u540djqmobi)\u7684<code>af.scroller.js<\/code>\u65b9\u6cd5\u3002<\/p>\n<p>\u524d\u8005<code>34K<\/code>\uff0c\u540e\u8005\u5462\uff0c\u6211\u52d2\u4e2a\u53bb\uff0c<code>63K<\/code>! \u6ca1\u9519\uff0c<code>63K<\/code>!\u4e00\u4e2a\u6eda\u52a8\u63d2\u4ef6<code>63K<\/code>, \u800c\u4e14\u662f\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u4f7f\u7528\u7684\uff0c\u79fb\u52a8\u8054\u901a\u7acb\u5373\u8868\u793a\u538b\u529b\u5f88\u5927\uff01<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/106.gif\" align=\"absmiddle\"> \u4eba\u5bb6&#8230;\u4eba\u5bb6..\u53ea\u662f\u4e2a\u5c0f\u9879\u76ee\uff0c\u5c31\u6307\u5934\u591a\u4e2aweb app\u9875\u9762\uff0c\u4f60&#8230;\u4f60..\u7a81\u7136\u9732\u51fa\u4e00\u8eab\u808c\u8089\uff0c\u4eba\u5bb6\u6015\u6015\u2026\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[648],"tags":[850,849,837,50,380],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/3505"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3505"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/3505\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}