最近我面临的挑战是开发轻量级web应用程序,所以我使用最少量的jQuery,因为在移动设备中查看时,无法保证流畅的行为。所以我选择了硬件加速的CSS转换。 您可以将网页内容放入两个div中,并动态添加和删除类以查看此效果。
/* CSS */
.page-one {
width: 100%;
-webkit-transform : translateX(0px);
height:100%;
position: fixed;
background-color: #fff;
color : #6B6B77;
box-shadow: -3px 3px 3px #ddd;
overflow: auto;
}
.page-one.invisible {
-webkit-transform: translateX(-100%);
}
.page-one,
body {
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
transition: all 0.3s ease;
}
.page-two {
-webkit-transform: translateX(100%);
}
.page-two.visible {
-webkit-transform: translateX(0px);
}
.page-two,
body {
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
transition: all 0.3s ease;
}
试试谷歌它.. – Dineshkani 2013-05-03 09:15:25