二级导航
2015-06-02 02:08
288 查看
$(document).bind("click",function(e){
var target = $(e.target);
if(target.closest("li,p").length == 0){
$("p").hide();
};
e.stopPropagation();
})*/
var $_this = $(".aa").find("span");
var $n = $_this.next();
$_this.click(function(event){
var $ul_d = $n.css("display");
if($ul_d == "none"){
$n.show();
}else{
$n.hide();
}
event.stopPropagation();
})
<ul>
<li class="aa">
<span>一级导行</span>
<ul>
<li>二级导航</li>
<li>二级导航</li>
</ul>
</li>
</ul>
var target = $(e.target);
if(target.closest("li,p").length == 0){
$("p").hide();
};
e.stopPropagation();
})*/
var $_this = $(".aa").find("span");
var $n = $_this.next();
$_this.click(function(event){
var $ul_d = $n.css("display");
if($ul_d == "none"){
$n.show();
}else{
$n.hide();
}
event.stopPropagation();
})
<ul>
<li class="aa">
<span>一级导行</span>
<ul>
<li>二级导航</li>
<li>二级导航</li>
</ul>
</li>
</ul>
相关文章推荐
- 黑马程序员——高新技术——反射2(指定类中的方法)
- J哥---------北京Android各招聘公司面试实战总结2
- ASP.NET菜鸟之路之Application小例子
- uvalive5721 Activation(概率dp)
- 解决NGUI与粒子系统的遮挡问题
- 深入理解javascript new的机制
- UNITY 4.6.4 发行说明 中文版
- Mac 平台搭建 Android 集成开发环境
- 2015baidu复赛 矩形面积(包凸 && ps:附quickhull模板)
- 第一天开通博客园博客的感受
- 人月神话:有多传奇?
- struts2使用struts2-bootstrap-plugin插件
- 刘(白书)之数论:约数、模线性方程
- 英语学习-语法-实词-名词
- FastJson
- Terminating app due to uncaught
- Netty HTTP 服务端入门开发
- ubuntu 15.04 下 GFirefly环境搭建和运行出现的问题和解决方案
- 让开发效率爆表的Guava ---- Table矩阵
- Android Studio 使用技巧(6)