这次给大家带来html+css+jquery做选项卡,html+css+jquery做选项卡的注意事项有哪些,下面就是实战案例,一起来看一下。
列表选项卡 body{ margin:0px; padding:0px; } #main{ width:310px; border:1px solid #C8C8CC; margin-left:auto; margin-right:auto; margin-top:50px; } .main_title{ width:310px; border-bottom:1px solid #C8C8CC; height:30px; } #main div .chang{ border:1px solid #C8C8CC; float:left; width:153px; height:26px; text-align:center; padding-top:4px; cursor:pointer; } .main_head{ width:310px; height:25px; background-color:#FFF4F8; } .main_head font{ font-size:13px; color:#808080; margin-top:5px; } .main_content{ width:310px; border-top:1px solid #808080; } .main_content ul{ margin-left:-30px; margin-top:5px; width:290px; } .main_content ul li{ list-style-type:none; font-size:13px; color:#2464B2; border-bottom:1px dotted #808080; line-height:27px; } .main_content ul li a{ font-size:13px; color:#2464B2; text-decoration:none; } .main_content ul li a:hover{ text-decoration:underline; } #main div ul.main_content_chang{ width:290px; position:relative; z-index:100; top:0px; left:0px; display:block; } #main div ul{ position:relative; display:none; } $(function(){ $(".chang").each(function(index){ $(this).click(function(){ $(this).css("background-color","#E02D29"); $(this).siblings("div").css("background-color","#fff"); $("#main div ul").removeClass("main_content_chang"); $(".main_content ul:eq("+index+")").show().siblings("ul").hide(); }) }) })
相信看了这些案例你已经掌握了方法,更多精彩请关注创想鸟其它相关文章!
相关阅读:
form上传文件后怎样提示保存action
怎样用按钮触发实现背景色的闪烁
立即学习“前端免费学习笔记(深入)”;
html里table表数据如何转为Json格式
html里怎样实现异步上传文件
以上就是html+css+jquery做选项卡的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1545791.html
微信扫一扫
支付宝扫一扫