在IE中使用JQuery UI切换时,Colums会调整大小 [英] Colums resize when using JQuery UI's toggle in IE
本文介绍了在IE中使用JQuery UI切换时,Colums会调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
示例代码:
<html>
<head>
<script src="jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script>
</head>
<body>
<table border="1" style="width:100%">
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
</tr>
<tr>
<td colspan="4" >
<div id="target">TOGGLE TEXT!!</div>
</td>
</tr>
</table>
<input type="button" value="show/hide" onclick="toggleHidden();" />
<script type="text/javascript">
function toggleHidden() {
$('#target').toggle("blind", {}, 200, null);
}
</script>
</body>
</html>
此代码使用JQuery UI的切换功能隐藏并显示td中的div(与显示和隐藏功能)。
This code hides and shows a div in a td, using JQuery UI's toggle function (same result with the show and hide functions).
在FireFox中这很好用,但在IE中,所有列都会在切换效果期间调整大小。有谁知道IE为什么会这样?如果我可以在此代码中执行任何操作以防止它发生?
In FireFox this works great, but in IE all the columns will resize during the "toggle effect". Does anyone know why IE behaves like this? And if there is anything I can do in this code to prevent it from happening?
推荐答案
使用 slideToggle 而不是切换或隐藏/显示实际解决了问题!
Using slideToggle instead of toggle or hide/show actually solved the problem!
这篇关于在IE中使用JQuery UI切换时,Colums会调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文