jquery类似百度百科底部导航预览,代码很简单,这里就不多废话了。
效果图:
CSS
* { margin: 0; padding: 0 } .wrap { width: 1000px; overflow: hidden; margin: 0 auto; } .content { width: 780px; float: left; } .slide { width: 200px; float: right; }
HTML
<div> <div> <h2> <a></a> <span>1</span> <span>part1</span> </h2> <div> content1,content1 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>2</span> <span>part2</span> </h2> <div> content2,content2 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <!--<span>2-1</span>--> <span>part2-1</span> </h2> <div> content2-1,content2-1 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <!--<span>2-2</span>--> <span>part2-2</span> </h2> <div> content2-2,content2-2 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>3</span> <span>part3</span> </h2> <div> content,content <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>4</span> <span>part4</span> </h2> <div> content,content <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>5</span> <span>part5</span> </h2> <div> content5,content5 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>6</span> <span>part6</span> </h2> <div> content6,content6 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>7</span> <span>part7</span> </h2> <div> content7,content7 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>8</span> <span>part8</span> </h2> <div> content8,content8 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>9</span> <span>part9</span> </h2> <div> content9,content9 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>10</span> <span>part10</span> </h2> <div> content10,content10 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>11</span> <span>part11</span> </h2> <div> content11,content11 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>12</span> <span>part12</span> </h2> <div> content12,content12 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>13</span> <span>part13</span> </h2> <div> content13,content13 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>14</span> <span>part14</span> </h2> <div> content14,content14 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </div> <h2> <a></a> <span>15</span> <span>part15</span> </h2> <div> content15,content15 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> bottom </div> </div> <div> <div> <div> <div> <div></div> <div></div> </div> <div> <div title="向上翻页"></div> <div title="向下翻页"></div> </div> <div> <dl> <!-- <dd> <span>1</span> <a title="part1" href="#1">part1</a> <span></span> </dd> <dd> <span>2</span> <a title="part2" href="#2">part2</a> <span></span> </dd> <dd> <span>2-1</span> <a title="part2" href="#2-1">part2-1</a> <span></span> </dd> --> </dl> </div> </div> <a href="javascript:void(0);"></a> <a title="返回顶部" href="javascript:void(0)"></a> </div> </div> </div>
JS