我该怎么做?我知道这是简单的简单JQuery,但我的知识缺乏。任何帮助将非常感激。这是代码:
$(document).ready(function(){
//Expand Div
$("#expandbutton").click({
over: ExpandDiv,
timeout: 100,
out: DoNothing
});
});
function ExpandDiv(){
$("#expander").animate({"height":200},400, "easeOutSine");
$("#expandbutton").css({opacity: 0.0, visibility: "hidden"}).animate({opacity: 0.0});
}
答案 0 :(得分:0)
要在点击时简单地执行ExpandDiv
方法,您可以像这样使用jQuery的.click()
:
$(document).ready(function(){
//Expand Div
$("#expandbutton").click(ExpandDiv);
});
答案 1 :(得分:0)
将参数传递给click()
$("#expandbutton").click({timeout: 100, out: DoNothing},
ExpandDiv);