[jquery-dev] Re: live event handlers

2009-02-19 Thread Mark Gibson
Raised ticket: http://dev.jquery.com/ticket/4189 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this g

[jquery-dev] Re: live event handlers

2009-02-18 Thread John Resig
> There was a brief discussion about binding to the current context > rather than document, which is similar to what you are suggesting: > > http://groups.google.com/group/jquery-dev/browse_thread/thread/911a50d2a0ed64b9 > > John, should I raise a ticket for this? Sure. I already have it on my to

[jquery-dev] Re: live event handlers

2009-02-18 Thread Mark Gibson
There was a brief discussion about binding to the current context rather than document, which is similar to what you are suggesting: http://groups.google.com/group/jquery-dev/browse_thread/thread/911a50d2a0ed64b9 John, should I raise a ticket for this? On Feb 17, 9:21 am, weepy wrote: > Re th

[jquery-dev] Re: live event handlers

2009-02-17 Thread weepy
Re the following code : >$(".grid").bind('click', function(ev) { > var sq = $(ev.target).closest('.sq'); > ... > >}); Would make sense to support this with live by specifying the parent element (".grid") in this case? I.e. the above could be written something like this: $(".sq").live("click",

[jquery-dev] Re: live event handlers

2009-02-16 Thread weepy
Ah - that's neat - thanks Mark On 16 Feb, 10:33, Mark Gibson wrote: > .live registers all handlers on document, so in this case would have > to filter all click events. > For this case you may be better off handling this at the grid level > and making use of .closest: > > $(".grid").bind('click'

[jquery-dev] Re: live event handlers

2009-02-16 Thread Mark Gibson
.live registers all handlers on document, so in this case would have to filter all click events. For this case you may be better off handling this at the grid level and making use of .closest: $(".grid").bind('click', function(ev) { var sq = $(ev.target).closest('.sq'); ... }); On Feb 15

[jquery-dev] Re: live event handlers

2009-02-15 Thread Daniel Friesen
$('#foo').live('click', myfunc ) Would have poor performance compared to: $('#foo').bind('click', myfunc ) Live is good in cases where you want to delegate amongst a large number of nodes. If you only have one or two, then it just reduces performance because then the delegated functions get cal