iphone手机桌面滑动效果使用css3实现
iphone手机桌面效果,因为用了css3样式,只测试了谷歌浏览器。
iphone手机桌面效果
body,div,ul,li{padding: 0; margin: 0; }
li{list-style: none; }
body {background: #333; }
#iphone {width: 900px; height: 600px; background: url(http://zsrimg.ikafan.com/file_images/article/201212/mobilhdmenu/bg.jpg); position: absolute; top: 50%; left: 50%; margin: -300px 0 0 -450px; }
#wrap {width: 240px; height: 360px; position: absolute; top: 121px; left: 326px; overflow:hidden; }
#iphone ul#zm {width: 1200px; height: 360px; cursor: pointer; position: absolute; top: 0px; left: 0px; background:url(http://zsrimg.ikafan.com/file_images/article/201212/mobilhdmenu/background.jpg) center center;}
#iphone ul#zm li {float: left; width:240px; height:350px;padding-top:10px;overflow:hidden;}
#iphone ul#zm li div{float: left; width:60px; height:80px; background-repeat: no-repeat;margin: 10px;position: relative;}
#iphone ul#zm li div.icon::after{bottom: -8px;color:#fff;content: attr(title);font-size: 12px;height: 20px;left: -8px;overflow: hidden;position: absolute;text-align: center;white-space: nowrap;width: 74px;text-shadow: 0 0 3px #222;}
#iphone ul#btn{position:absolute;left:60px;bottom:5px;width:140px;height:30px;}
#iphone ul#btn li{float:left;width:6px;height:6px;border-radius:50%;background:#fff;margin:10px;}
#iphone ul#btn li.current{background:#00A2D6;}
function startMove(e,t){if(e.oTimer){clearInterval(e.oTimer)}e.oTimer=setInterval(function(){doMove(e,t)},30)}function doMove(e,t){var n=e.offsetLeft;iSpeed+=(t-n)/5;iSpeed*=.7;n+=iSpeed;if(Math.abs(t-n)=0){if(e.offsetLeft>e.iStartX){iNow--;if(iNow=t.length){iNow=t.length-1}}}startMove(e,-iNow*t[0].offsetWidth);var n=document.getElementById("btn");var r=n.getElementsByTagName("li");for(var i=0;i
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]