gpt4 book ai didi

javascript - 表 (.animate) 的 Jquery 问题

转载 作者:行者123 更新时间:2023-11-28 02:49:08 27 4
gpt4 key购买 nike

我想要为我的网站添加一个最小化表格按钮,所以我只是在摆弄一些 Jquery,我想知道为什么在单击该按钮后(并且它减小了其大小)它会恢复到默认大小吗? -.animate 完成后?

http://zombiewrath.com/maintest2.php

-在那里尝试一下,

代码:

<html>
<head>
<style type="text/css">
#tablemin {
height:inherit;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<body>
<input type="button" value="Click Here" onClick="dostuff();">
<div id="tablemin">
<table bordercolor="#0000FF" width="670" border="1">
<tr>
<td class="style5" width="400" valign="top" style="width: 300px"><b><u>Personal Feed: </u></b><br>
</td>
<td class="style5" width="355" valign="top"><u><strong>Live Feed:</strong> </u><br>
<div id="ReloadTime3" style="width: 350px">
</div></td>
</tr>
<tr>
<td class="style5" valign="top" colspan="3" style="width: 488px"><b><u>Local news for Zone B-4...</u></b></td></tr>
</table>
</div>
<script type="text/javascript">
function dostuff() {
$("#tablemin").animate({
//opacity: "0.4",
height: "50px"
}, 1000 );

}
//$(document.body).click(function () {
//$('#tablemin').animate({height:'1px'}, 'slow');
//$('#tablemin').fadeOut(1);
//});
</script>
Hi
</body></html>

非常感谢

最佳答案

why after the button is clicked (and it reduced its size) it grows back to the default size?

使用您当前的代码,执行此操作,

<style type="text/css">
#tablemin {
height:inherit;
overflow: hidden;
}
</style>

关于javascript - 表 (.animate) 的 Jquery 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4163252/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com