jquery 选择器 a 更多 简化
来源:互联网 发布:产品设计软件 axure 编辑:程序博客网 时间:2024/05/16 11:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>挑战题</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li>ffff</li>
<li>ddd</li>
<li style="display:none">rrrr</li>
<li style="display:none">wwww</li>
<a id="moreInfo" href="javascript:;" onclick="showMore(this.id)">更多</a>
</ul>
<script>
$("li:hidden").show();
$("#moreInfo").html("简化");
}else{
$("li:eq(2)").css("display","none");
$("li:eq(3)").css("display","none");
$("#moreInfo").html("更多");
}
}
</script>
</body>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>挑战题</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li>ffff</li>
<li>ddd</li>
<li style="display:none">rrrr</li>
<li style="display:none">wwww</li>
<a id="moreInfo" href="javascript:;" onclick="showMore(this.id)">更多</a>
</ul>
<script>
function showMore(btnid){
//ID选择器需要加“#”
if($("#moreInfo").html()=="更多"){$("li:hidden").show();
$("#moreInfo").html("简化");
}else{
$("li:eq(2)").css("display","none");
$("li:eq(3)").css("display","none");
$("#moreInfo").html("更多");
}
}
</script>
</body>
</html>
0 0
- jquery 选择器 a 更多 简化
- JQuery插件: moreSelectors为jQuery提供更多的选择器
- 日期选择器DatePickerDialog简化使用
- 简化后的省市区选择器
- CSS选择器,jQuery选择器
- jQuery选择器 CSS选择器
- JQuery选择器(选择器简介)
- jQuery选择器 基本选择器
- jQuery选择器 层次选择器
- jQuery选择器 表单选择器
- Jquery选择器-基本选择器
- jQuery选择器之类选择器
- jQuery选择器之类选择器
- jQuery选择器之类选择器
- Jquery选择器--过滤选择器
- a毛 jquery 学习记 3 常规选择器(1)
- a毛 jquery 学习记 3 常规选择器(2)
- a毛 jquery 学习记 3 常规选择器(3)
- Java并发编程:线程池的使用
- Ubuntu14.04下MySQL数据库无法远程访问的问题
- AngularJS 剽悍的Ajax和承诺
- Linux grep命令
- MES服务器端配置——系统集成工具
- jquery 选择器 a 更多 简化
- Maven的那些事
- getaddrinfo函数详细解释
- 收藏的优秀网站(备份一下)
- [leetcode] nim game
- Android图片加载库测试
- app开发icon图片自适应方案
- 备份恢复以及replication复制问题
- 程序员必知的七个图形工具