<div id="foldzone_1">
<tr class="list">
<td width="90" align="center" class="title"></td>
</tr>
</div>$('#foldzone_1').toggle(function(){
$(this).hide();
}, function(){
$(this).show();
});
看不出代码有什么问题
<tr class="list">
<td width="90" align="center" class="title"></td>
</tr>
</div>$('#foldzone_1').toggle(function(){
$(this).hide();
}, function(){
$(this).show();
});
看不出代码有什么问题
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.wanmei.com/public/js/jq_132.js"></script>
<title>无标题文档</title></head><body><div id="foldzone_1">
<tr class="list">
<td width="90" align="center" class="title">11111111</td>
</tr>
</div>
<script>
$('#foldzone_1').toggle(function(){
$(this).hide();
}, function(){
$(this).show();
});</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.wanmei.com/public/js/jq_132.js"></script>
<title>无标题文档</title></head><body>
<input type="button" id="btn" title="Click me 你会看到效果" value="点击此处" />
<div id="content" style="padding:10px; margin-top:5px; border:1px dotted #BBB;"></div>
<script>
$(function(){$("#btn").toggle(function(){$("#content").hide();},
function(){$("#content").show();});})
</script>
</body>
</html>正确用法
<script>
$(function(){$("#btn").click(function(){
$("#content").slideToggle("fast")
});})
</script>
“#foldzone_1“这个是层的ID,$('#foldzone_1').toggle(function(){
$(this).hide();
}, 这句执行完后层已经不再界面上了, 怎么还能实现function(){
$(this).show();
});
这个功能呢,可以做做适当修改。说的不太清楚,望谅解!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.wanmei.com/public/js/jq_132.js"></script>
<title>无标题文档</title>
<script type="text/javascript">
$(document).ready(function () {
$('#foldzone_1').toggle(function () {
$('.list').hide();
}, function () {
$('.list').show();
});
})
</script>
<style type="text/css">
div
{
background-color:red;
height: 54px;
}
td
{background-color:blue;
}
</style></head>
<body><div id="foldzone_1" >
<table>
<tr class="list">
<td width="90" align="center" class="title">11111111</td>
</tr>
</table>
</div>
少用‘this’