- I’m using the Hoverintent JQuery plugin to make a DIV expand.
- Now I want it to work “on click” rather than “on hover”
How do I do this? I know this is simple simple JQuery, but my knowledge is lacking. Any help would be much appreciated. Here is the code:
$(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});
}
To simply execute that
ExpandDivmethod on click, you can use jQuery’s.click()like this: