我想實現這個很好的效果,稱爲平滑頁面滾動與緩動效應。我遵循本教程的說明:http://tympanus.net/codrops/2010/06/02/smooth-vertical-or-horizontal-page-scrolling-with-jquery/平滑的頁面滾動實施?
我想要做的就是點擊一個來自我的導航欄的鏈接,這將使我的頁面垂直滾動(很好)到確切的位置,但它不是加工。
希望你們能幫忙!提前致謝!!!
<!DOCTYPE html>
<html>
<head>
<title>Smooth Page Scrolling</title>
<script type='text/javascript' src='smoothpagescrolling.js'></script>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
</head>
<body>
<header>
<a href="#" id="logo">Logo</a>
<ul id="nav" class="nav">
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#gallery">Gallery</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</header>
<section id="hero1" class="hero">
<div class="inner">
<div class="copy">
<h1>Home</h1>
<p>Some text here!</p>
</div>
</div>
</section>
<section class="content">
<div class="inner">
<div class="copy">
<h1>About</h1>
<p>Some text here... </p>
</div>
</div>
</section>
<section id="hero2" class="hero">
<div class="inner">
<div class="copy">
<h1>Services</h1>
<p>Some text here... </p>
</div>
</div>
</section>
<section class="content">
<div class="inner">
<div class="copy">
<h1>Gallery</h1>
<p>Some text here... </p>
</div>
</div>
</section>
<section class="newsection">
<h1>Contact</h1>
<p>E-mail: [email protected]</p>
</section>
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Noto+Sans' rel='stylesheet' type='text/css'>
</body>
</html>
我建議的方式有問題這種方法:http://css-tricks.com/snippets/jquery/smooth-scrolling/ – wandarkaf
你的腳本???? –
這不是我的腳本。我只是用它來學習。所以我試圖在這裏實現平滑的頁面滾動。我對網絡開發很陌生,所以我想弄清楚不同的概念是如何工作的。 –