最近我面臨的挑戰是開發輕量級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