為什么用anchors后刷新頁面,網(wǎng)址沒有改變
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="../css/jquery.fullpage.css">
<title>無標題文檔</title>
<style>
.slide{
text-align: center;
font-size: 30px;
}
*{
color:white;
}
</style>
</head>
<body>
<div id="fullpage">
? <div class="section section1"><h1>這是第一屏</h1></div>
? <div class="section section2"><h1>這是第二屏</h1>
? ? <div class="slide">slide1</div>
? ? <div class="slide">slide2</div>
? ? <div class="slide">slide3</div>
? ? <div class="slide">slide4</div>
? </div>
? <div class="section section3"><h1>這是第三屏</h1></div>
? <div class="section section4"><h1>這是第四屏</h1></div>
</div>
<script src="../new2/js/jquery-3.2.0.min.js"></script>
<script src="../new2/js/jquery.fullpage.js"></script>
<script>
? $(document).ready(function(){
? ? ?$("#fullpage").fullpage({
sectionsColor:['black','red','green','orange'],
/*controlArrows:false,
verticalCentered:false,*/
anchors:['page1','page2','page3','page4']
});
? })
</script>
</body>
</html>
2017-08-11
你忘記先引入jquery和fullPage文件了
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
<script src="https://cdn.bootcss.com/fullPage.js/2.9.4/jquery.fullpage.js"></script>