用到fullPage插件javascript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.6.7/jquery.fullPage.css"/>
<style media="screen">
*{
margin: 0px;
padding: 0px;
text-align: center;
}
</style>
</head>
<body>
<div id="fullpage">
<div class="section">
第一頁
</div>
<div class="section">
<div class="slide">第二頁的第一屏</div>
<div class="slide">第二頁的第二屏</div>
<div class="slide">第二頁的第三屏</div>
<div class="slide">第二頁的第四屏</div>
</div>
<div class="section">第三頁</div>
<div class="section">第四頁</div>css
</div>html
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.js"></script>java
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.7.8/jquery.fullPage.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#fullpage').fullpage({
// 設置每一屏的顏色
sectionsColor:['rgb(92, 185, 135)','rgb(226, 179, 99)','rgb(101, 175, 213)','rgb(223, 135, 175)'],
// 隱藏尖頭 , 默認爲true
// controlArrows:false,
// 每一頁的內容是否垂直居中 , 默認爲true
// verticalCentered:false
// 字體是否隨着窗口縮放而縮放 , 默認爲false
// resize:true
// 滾動速度,單位爲毫秒,默認爲700
// scrollingSpeed:2000
// 定義錨連接
// anchors:['pag1','page2','page3','page4'],jquery
});
});
</script>ajax
</html>ide