您的位置:首页 > Web前端 > JQuery

使用jquery可见性过滤选择器

2016-05-27 22:14 549 查看
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>使用jquery可见性过滤选择器</title>
<script src="jquery-1.8.0.js"></script>
</head>
<style type="text/css">
body{
font-size:12px;
text-align;center;
}
div,span{
float:left;
border:solid 1px red;
margin:8px;
width:65px;
height:65px;

}
.GetFous{
border:solid 1px #666;
background-color:#eee;
}
</style>

<script type="text/javascript">

$(function(){
$("span:hidden").show();
$("div:visible").addClass("GetFous");	//增加所有可见元素的类别
});
/*
$(function(){
$("span:hidden").show().addClass("GetFous");
$("div:visible").addClass("GetFous");
});
*/
</script>
<body>
<span style="display:none;">Hiddin</span><!-- 不可见元素 -->
<div>Visible</div><!-- 可见元素 -->
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: