显示扩展目录(jquery)
来源:互联网 发布:phpstorm 连接mysql 编辑:程序博客网 时间:2024/06/06 05:10
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style>
.prompted a{color:#ff0000;}
</style>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script src="Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(function(){
$("button").click(function(){
alert("helloworld");
});
})
$(function () {
//1.选择从“a”->"x" 的li 标签 $category
var $category = $("li:gt(1):not(:last)");
//2.把他们隐藏
$category.hide();
//3. 为.showmore添加一个onclick响应函数
$(".showmore").click(function () {
if($category.is(":hidden")){
$(".showmore>a>span").text("显示精简品牌");
$category.show();
$("li:contains('佳能'),li:contains('尼康')").addClass('prompted');
}
else
{
$(".showmore>a>span").text("显示全部品牌");
$category.hide();
//$("li:contains('佳能'),li:contains('尼康')").addClass('prompted');
$("li").removeClass('prompted');
}
return false;
})
//4. 若$category是隐藏的
//4.1 $category显示
//4.2 使“尼康” 高亮显示
})
</script>
</head>
<body>
<!-- <button id="showmore">click me </button>-->
<div class="SubCategoryBox">
<ul>
<li><a href="#">佳能</a><i>(3)</i></li>
<li><a href="#">尼康</a><i>(5)</i></li>
<li><a href="#">索尼</a><i>(6)</i></li>
<li><a href="#">佳能1</a><i>(3)</i></li>
<li><a href="#">尼康2</a><i>(5)</i></li>
<li><a href="#">索尼3</a><i>(6)</i></li>
<li><a href="#">三星</a><i>(3)</i></li>
<li><a href="#">富士康</a><i>(5)</i></li>
<li><a href="#">宾得</a><i>(6)</i></li>
</ul>
</div>
<div class="showmore">
<a href="#hehe.html"><span>显示全部品牌</span></a>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style>
.prompted a{color:#ff0000;}
</style>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script src="Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(function(){
$("button").click(function(){
alert("helloworld");
});
})
$(function () {
//1.选择从“a”->"x" 的li 标签 $category
var $category = $("li:gt(1):not(:last)");
//2.把他们隐藏
$category.hide();
//3. 为.showmore添加一个onclick响应函数
$(".showmore").click(function () {
if($category.is(":hidden")){
$(".showmore>a>span").text("显示精简品牌");
$category.show();
$("li:contains('佳能'),li:contains('尼康')").addClass('prompted');
}
else
{
$(".showmore>a>span").text("显示全部品牌");
$category.hide();
//$("li:contains('佳能'),li:contains('尼康')").addClass('prompted');
$("li").removeClass('prompted');
}
return false;
})
//4. 若$category是隐藏的
//4.1 $category显示
//4.2 使“尼康” 高亮显示
})
</script>
</head>
<body>
<!-- <button id="showmore">click me </button>-->
<div class="SubCategoryBox">
<ul>
<li><a href="#">佳能</a><i>(3)</i></li>
<li><a href="#">尼康</a><i>(5)</i></li>
<li><a href="#">索尼</a><i>(6)</i></li>
<li><a href="#">佳能1</a><i>(3)</i></li>
<li><a href="#">尼康2</a><i>(5)</i></li>
<li><a href="#">索尼3</a><i>(6)</i></li>
<li><a href="#">三星</a><i>(3)</i></li>
<li><a href="#">富士康</a><i>(5)</i></li>
<li><a href="#">宾得</a><i>(6)</i></li>
</ul>
</div>
<div class="showmore">
<a href="#hehe.html"><span>显示全部品牌</span></a>
</div>
</body>
</html>
0 0
- 显示扩展目录(jquery)
- 利用jQuery无插件创建可扩展目录树
- jQuery扩展命名空间(扩展方法)
- java jquery扩展(prototype)
- jquery-easyui中datagrid扩展,隐藏显示表头功能
- jquery扩展,显示模态DIV层 (一)
- jquery扩展,显示模态DIV层 (二)
- JQuery 扩展
- jquery扩展
- jquery 扩展
- jquery 扩展
- Jquery 扩展
- jquery扩展
- jquery扩展
- Jquery扩展
- jquery扩展
- jQuery扩展
- jQuery扩展
- 决策树(1)ID3
- 理解inode
- webpack +Reactjs +babel 加载器配置
- linux把引导程序装在U盘上的解决办法
- 【校园招聘】:IT校招的准备及注意事项
- 显示扩展目录(jquery)
- Maven - 【日常问题】
- ArcGIS教程:了解欧氏距离分析
- 从 NSURLConnection 到 NSURLSession
- iOS 性能优化:Instruments 工具的救命三招
- MVVM模式
- 关于在使用EXTJS过程中页面出现白板的解决方法
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- python 查看API