静态列表里点击上一页下一页切换列?

[html部分]
<div class="small_dashiji_box">
    <div class="small_dashiji">
    <div class="small_dashiji">
    <div class="small_dashiji">
</div>
<div class="small_dashiji_box" style="display:none">
    <div class="small_dashiji">
    <div class="small_dashiji">
    <div class="small_dashiji">
</div>
<div class="small_dashiji_box" style="display:none">
    <div class="small_dashiji">
    <div class="small_dashiji">
    <div class="small_dashiji">
</div>
<div class="yema">
           <span class="before_page" id="before_page">上一页</span>
            <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
            <div class="clearfix"></div>
            </ul>
            <span class="after_page" id="after_page">下一页</span>
            <div class="clearfix"></div>
        </div>

<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>

<script>

$('.yema li').click(function () {

   var i = $(this).index();

   $(".small_dashiji_box").hide(0)

   $(".small_dashiji_box").eq(i).show(0)

})

</script>

安静的沙漠
浏览 2055回答 1
1回答

业余奶茶品鉴师

<div class="small_dashiji_box">     <div class="small_dashiji">aaaaa</div>     <div class="small_dashiji">aaaaaaaaa</div>     <div class="small_dashiji">aaaaaaaaaaaaa</div> </div> <div class="small_dashiji_box" style="display:none">     <div class="small_dashiji">bbbbb</div>     <div class="small_dashiji">bbbbbbbb</div>     <div class="small_dashiji">bbbbbbbbbbbb</div> </div> <div class="small_dashiji_box" style="display:none">     <div class="small_dashiji">ccccc</div>     <div class="small_dashiji">cccccccc</div>     <div class="small_dashiji">ccccccccccccc</div> </div> <div class="yema">      <span class="before_page" id="before_page">上一页</span>           <ul>               <li>1</li>               <li>2</li>               <li>3</li>               <li>4</li>               <li>5</li>               <div class="clearfix"></div>           </ul>     <span class="after_page" id="after_page">下一页</span>     <div class="clearfix"></div> </div>html改成这样就可以了。没有什么大问题。但需要注意div是双标签。<div></div>成对出现,你只写了一半。望采纳
打开App,查看更多内容
随时随地看视频慕课网APP