> Can I force the click event to fire manually?
To trigger an event you can use...wait for it...trigger(). :-)
$("foo").trigger("click");
Or you can call click with no arguments:
$("foo").click();
As with a real click, the "this" will be pointing to the element. I'm not
sure about the details of the first (event) argument in these cases.
However, you can tell a real click from a fake click by passing trigger some
arguments:
$("foo").trigger("click", ["other", "stuff", "here"]);
$(".foo").click(function (e, p1, p2) {
if ( p2 == "stuff" )
alert("I was triggered, not clicked.");
else
alert("Finally, an honest click.");
});
So is this some sort of van den Hoven family reunion around here? :-)
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/