为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

安静的沙漠 2016-09-05 12:32:48
[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>
查看完整描述

1 回答

?
业余奶茶品鉴师

TA贡献260条经验 获得超388个赞

<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>成对出现,你只写了一半。

望采纳

查看完整回答
1 反对 回复 2016-09-08
  • 1 回答
  • 0 关注
  • 2040 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信