jQuery中的eq(0)到底是什么意思??详情请看下面代码!
手风琴效果*{padding:0; margin:0;}
.box{margin:50px auto; width:300px; height: auto; border: solid 1px #cccccc;}
.Collapsing{ width: 100%; height: 30px; line-height: 30px; cursor: pointer; border-bottom: 1px solid white; text-align: center; background-repeat: no-repeat; background-position: center right no-repeat; background-image: url(images/pro_left.png); background-color: #BDBDBD; color: #fff; }
.coll_body{display: none; }
.coll_body a{display:block; margin:10px; text-align: center; background: #ebebeb;}
.current{background-image:url(images/pro_down.png);}
$(function(){
$(".coll_body").eq(0).show();//这句话是什么意思呢??
// $(".coll_body").eq(0):不是只匹配页面上第一个coll_body吗?为什么其他的 coll_body也会相应生效????求解
$(".Collapsing").click(function(){
$(this).toggleClass("current").siblings('.Collapsing').removeClass("current");//切换图标
$(this).next(".coll_body").slideToggle(500).siblings(".coll_body").slideUp(500);
});
});
相关阅读:
如何给静态html 引用的js或者css路径后面加上时间戳
js 字符串转html标签
jquery alert
工作流框架osworkflow, jBPM和Activiti,该如何选择
获取微信授权的时候 页面报错net err blocked by client
yii2里让每个页面在公用的layout里,都能取到session的值,各位咋做的?
jar包配置环境变量?
关于Vue插件中prototype和全局mixin选择的问题
avalonjs组件怎么暴露设置函数出去
webpack2 如何作loader的模块匹配
如何屏蔽页面上所有a标签的跳转?
不同ip地址,不同域名,能通过cors跨域吗?
ms-click 二级联动赋值有错误
vue cli 使用npm run dev 报错Cannot GET /
java 爬虫多线程读取同一个集合
xampp apache 运行一段时间崩溃,提示 “apache http server 已停止工作”
react 绑定this 与State 提交大家都是怎么做的呢?
react-redux @connect 修饰器的用法问题
flask tag页面怎么实现
js时间戳问题