使用原生js编写,没有使用jQuery插件,
首先是HTML部分:
<body>
<div id="main">
<div class="section">
<div class="content">
<h1>this is the first page</h1>
</div>
</div>
<div class="section>
<div class="content">
<h1>this is the second page</h1>
</div>
</div>
<div class="section">
<div class="content">
<h1>this is the third page</h1>
</div>
</div>
<div class="section">
<div class="content">
<h1>this is the fourth page</h1>
</div>
</div>
</div>
</body