js页脚点击展开折叠弹窗效果
2017-08-04 11:05
483 查看
js页脚点击展开折叠弹窗效果
用的是bootstrap框架
修改里面的js插件Collapse
用的是bootstrap框架
修改里面的js插件Collapse
html代码
<footer> <div class="container"> <div class="panel panel-default"> <div class="panel-heading"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseThird" aria-expanded="false" class="collapsed clearfix"> <span class="pull-right"><button class="btn btn-default down" type="submit"><i class="iconfont "></i></button><button class="btn btn-default up" type="submit"><i class="iconfont"></i></button></span> </a> </div> <div id="collapseThird" class="panel-collapse collapse"> <div class="panel-body"> <div class="friendLinks"> <div class="container"> <div class="row"> <div class="col-xs-2"> <div class="linksTitle">友情链接</div> <hr size="4" color="#f5874a"> </div> <div class="col-xs-8"> <div class="list1 col-xs-4"> <ul> <li><a href="#">CSDNCSDNCSDNCSDNCSDN</a></li> <li><a href="#">宁皓网宁皓网宁皓网宁皓网</a></li> <li><a href="#">慕课网慕课网</a></li> </ul> </div> <div class="list2 col-xs-4"> <ul> <li><a href="#">CSDNCSDNCSDNCSDNCSDN</a></li> <li><a href="#">宁皓网宁皓网宁皓网宁皓网</a></li> <li><a href="#">慕课网慕课网</a></li> </ul> </div> <div class="list3 col-xs-4"> <ul> <li><a href="#">CSDNCSDNCSDNCSDNCSDN</a></li> <li><a href="#">宁皓网宁皓网宁皓网宁皓网</a></li> <li><a href="#">慕课网慕课网</a></li> </ul> </div> </div> </div> </div> </div> </div> </div> </div> <span>©2017 CSDN All Rights Reserved. </span> </div> </footer>
css代码
footer { background: #fafafa; padding-bottom:25px; display: block; font-size: 12px; color: #444; font-family:"微软雅黑"; text-align: center; } footer .down{ position: relative; right: 83px; top:34px; display: none; } footer .up{ position: relative; right: 83px; top:34px; } footer .btn.active.focus, footer .btn.active:focus,footer .btn.focus,footer .btn:active.focus,footer .btn:active:focus,footer .btn:focus { outline: none ; outline-offset: -2px; } footer .btn-default.active.focus,footer .btn-default.active:focus, .btn-default.active:hover, .btn-default:active.focus, .btn-default:active:focus, .btn-default:active:hover, .open>.dropdown-toggle.btn-default.focus, .open>.dropdown-toggle.btn-default:focus, .open>.dropdown-toggle.btn-default:hover { color: #333; background-color: #fff; border-color: #ccc; } footer .panel-default { border: none; background: #fafafa; } footer .panel-default > .panel-heading { background-color: #fafafa; border-bottom: #c1002a 1px solid; } footer .panel-default > .panel-heading + .panel-collapse > .panel-body { border-bottom: #c1002a 1px solid; } footer .panel-body { padding: 10px; } /*友情链接样式*/ .friendLinks { width: 100%; margin: 0 auto; background: #fafafa;; } .linksTitle { margin: 0; height: 50px; line-height: 50px; font-size: 14px; font-weight: bold; color: #c1002a; } hr { margin-left: 54px; margin-top: -11px; width: 120px; height: 4px; background: -webkit-linear-gradient(left, #c1002a, #fff); background: -o-linear-gradient(right, #c1002a, #fff); background: -moz-linear-gradient(right, #c1002a, #fff); background: linear-gradient(to right, #c1002a, #fff); } .friendLinks ul li { list-style: none; line-height: 30px; } .friendLinks a { color: #333; } .friendLinks a:focus, .friendLinks a:hover { color: #c1002a; } .friendLinks .list1, .list2, .list3 { margin-top: 10px; text-align: left; }
js代码
$(function () { $(".panel-heading>a").click(function () { if ($(this).find(".up").css("display") == "none"){ $(this).find(".down").css("display", "none"); $(this).find(".up").css("display", "inline-block"); }else { $(this).find(".down").css("display","inline-block"); $(this).find(".up").css("display","none"); } }) });
相关文章推荐
- 如何实现js展开收起(折叠)效果呢?例如:一段内容过长了,我限制他显示为20个字内,但是超出了20的就先用省略号代替,然后后面添加一个展开,点击展开后就显示所有的内容,这时候展开按钮就变成了 折叠按钮
- js单个点击展开,再点击折叠效果(IE/FF下通过)
- 多组处理, 仅展开一个区块的折叠效果(原生Js和jQ版)
- js和css3实现能够展开和折叠的折扇效果
- jquery实现点击查看更多内容控制段落文字展开折叠效果
- js实现点击展开隐藏效果(实例代码)
- js点击子菜单折叠,再点击子菜单展开
- JS实现鼠标滑过折叠与展开菜单效果代码
- 解决VS中CListCtrl中+点击没有效果(点击+不能展开再次点击不能折叠)
- js单个点击展开,再点击折叠效果(IE/FF下通过) .
- vue.js 实现点击展开收起动画效果
- JS点击查看更多内容 控制段落文字展开折叠
- js实现选项卡内容切换以及折叠和展开效果【推荐】
- JS+CSS实现的简单折叠展开多级菜单效果
- Bootstrap导航点击菜单跳转与点击缩放菜单折叠按钮缓冲效果插件jquery.singlePageNav.min.js
- [原创 js] 点击展开关闭效果
- js点击弹出div层实现可拖曳的弹窗效果
- [原创 js] 点击展开关闭效果
- 原生JS仿QQ阅读点击展开、收起效果
- js点击弹出div层实现可拖曳的弹窗效果