Re: [jQuery] triggering an event

2006-10-24 Thread Dave Methvin
> 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 detail

Re: [jQuery] triggering an event

2006-10-24 Thread Michael Geary
> I was wondering having done: > > $(".foo").click(function (e) {alert ("foo");}); > > Can I force the click event to fire manually, or do I resort to > > var x = function (e) {alert ("foo");} > $("#foo").click(x); > ele = $("#foo").get(0) > x.call( ele, {target:ele}); You can use either of the

Re: [jQuery] triggering an event

2006-10-24 Thread Klaus Hartl
Adam van den Hoven schrieb: > I was wondering having done: > > $(".foo").click(function (e) {alert ("foo");}); > > Can I force the click event to fire manually, or do I resort to > > var x = function (e) {alert ("foo");} > $("#foo").click(x); > ele = $("#foo").get(0) > x.call( ele, {target:ele})

Re: [jQuery] triggering an event

2006-10-24 Thread Webunity | Gilles van den Hoven
Adam van den Hoven wrote: > Can I force the click event to fire manually, or do I resort to > I think you can do this with the "apply" call, although i am unsure how ;) P.s. nice surname ;) ___ jQuery mailing list discuss@jquery.com http://jquery.com

[jQuery] triggering an event

2006-10-24 Thread Adam van den Hoven
I was wondering having done: $(".foo").click(function (e) {alert ("foo");}); Can I force the click event to fire manually, or do I resort to var x = function (e) {alert ("foo");} $("#foo").click(x); ele = $("#foo").get(0) x.call( ele, {target:ele}); Adam __