龙岩易富通日常工作笔记

记录日常工作中的点点滴滴

iscroll使用方法

2018.06.12 | 261阅读 | 0条评论 | 通用代码

<!DOCTYPE html>

<html>

<head>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />

<meta charset="utf-8" />

<title>iscroll演示</title>

<script src="jquery-1.9.1.min.js"></script>

<script src="iscroll.js"></script> 

<style type="text/css">

   a {color: #000;}

   li {list-style: none;}

   body {overflow: hidden;}

   .wrapper {position: relative; height: 100%;}

   .scroller {position: absolute; width: 100%;   transform: translate3d(0,0,0); -webkit-transform: translate3d(0,0,0);   -moz-transform: translate3d(0,0,0);}

</style>

<script type="text/javascript">

var myScroll1;

function loaded() {

   myScroll1 = new IScroll('.wrapper', { mouseWheel: true, click: true });

}

</script>

</head>

<body onload="loaded()">

    <div id="wrapper">

        <div id="scroller">

               <ul>

                    <li></li>

                    ...

                </ul>

        </div>

    </div>

</body>

</html>


赞 (

发表评论