[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>成对出现,你只写了一半。
望采纳
添加回答
举报
0/150
提交
取消