绑定我有一个JavaScript像这样的功能:在文件准备好,触发功能由点击
$("#table-filters li").click(function(){ *** Lots of stuff here...
});
我想发生是在页面加载时,一时间,运行该功能。东西包含在:
$(document).ready(function() {
});
建议?
谢谢!
绑定我有一个JavaScript像这样的功能:在文件准备好,触发功能由点击
$("#table-filters li").click(function(){ *** Lots of stuff here...
});
我想发生是在页面加载时,一时间,运行该功能。东西包含在:
$(document).ready(function() {
});
建议?
谢谢!
使用此:
$("#table-filters li").trigger("click");
$(function(){
$("#table-filters li")
.click(function(){
// Lots of stuff here...
})
.slice(0,1).click();
});
$("#table-filters li:first").trigger("click");
你的问题没有说你只想点击第一个'li'。另外两个用户已经提供了很好的答案。请接受他们的一个。 – Sampson 2010-01-10 19:46:25
这是行不通的。看起来,点击了ul中的所有LI。有没有办法为FIRST LI单击一下? – AnApprentice 2010-01-10 19:41:55
行了! (“#table-filters li:first”)。trigger(“click”); 感谢提示 – AnApprentice 2010-01-10 19:43:41