常用移动开发代码

来自ling
跳转至: 导航搜索

滑动效果

  • 引用 <script src="resource/thirdpartyjs/iscroll5.min.js"></script>
<div id="regionScroller">
			<section>
				<dl class="content">
					<dd ng-repeat="item in city_list track by $index" ng-click="regionClick($index,item)" ng-bind="item"></dd>
				</dl>
			</section>
		</div>
iScrollClick=function(){
	    if (/iPhone|iPad|iPod|Macintosh/i.test(navigator.userAgent)) 
	        return !1;
	    if (/Chrome/i.test(navigator.userAgent)) 
	        return /Android/i.test(navigator.userAgent);
	    if (/Silk/i.test(navigator.userAgent)) 
	        return !1;
	    if (/Android/i.test(navigator.userAgent)) {
	        var a = navigator.userAgent.substr(navigator.userAgent.indexOf("Android") + 8,3);
	        return 44 > parseFloat(a[0] + a[3]) ? !1 : !0
	    }   
	}
	regionScroller = new IScroll("#regionScroller",{
	    scrollY: !0,
	    click: iScrollClick
	});