我正在通过load()方法将一个表加载到我的页面中。
表格的第一行是可单击的,单击时必须切换表格的其余部分。我使用的代码如下:
$('.collapsable tr:first').live('click', function() {
$('.collapsable tr:first').nextAll().slideToggle("fast");
});我希望在加载页面时隐藏该表。我尝试过使用:$('.collapsable tr:first').live('load',function() {,但没有成功。
我还尝试将$('.collapsable tr:first‘).nextAll().slideToggle(“.collapsable”);放入document.ready函数,但它同样什么也不做。
有人能帮帮忙吗?
谢谢
发布于 2011-08-01 20:51:47
这可能会对你有所帮助。
使用.click而不是.live:
$('.collapsable tr:first').click(function() {
$('.collapsable tr:first').nextAll().slideToggle("Show");
});https://stackoverflow.com/questions/6897318
复制相似问题