[jQuery] Re: Rare .die() behaviour

2009-07-13 Thread Leeoniya
created a ticket: http://dev.jquery.com/ticket/4894 On Jul 11, 1:57 pm, Leeoniya wrote: > yeah, that seems like a bug. here is a more concise version showing > the bug and a non-delegation based version: > > // without event delegation -- works fine > $(function() { >    

[jQuery] Re: Rare .die() behaviour

2009-07-11 Thread Leeoniya
yeah, that seems like a bug. here is a more concise version showing the bug and a non-delegation based version: // without event delegation -- works fine $(function() { $("#b").click(function() { $("#a span").unbind("click"); return false; });

[jQuery] Re: assign event handler to multiple events

2009-04-14 Thread Leeoniya
if you still need the performance of event delegation (live), you should make the handling function separately and assign it using several "live"s. eg: function handleStuff(e) { // do things } $("div > p, #nav a").live("click", handleStuff).live("keydown", handleStuff); be aware that live() d

[jQuery] Re: question about each function

2009-04-14 Thread Leeoniya
wait, you should be doing "return FALSE" rather than just "return" On Apr 14, 7:57 pm, Leeoniya wrote: > well according tohttp://docs.jquery.com/Core/each > returning false SHOULD break out of the loop, haven't tried it tho - i > can't imagine something

[jQuery] Re: question about each function

2009-04-14 Thread Leeoniya
well according to http://docs.jquery.com/Core/each returning false SHOULD break out of the loop, haven't tried it tho - i can't imagine something like this would be broken at this point, maybe your condition is never being met? On Apr 14, 7:51 pm, Leeoniya wrote: > i, too, am c

[jQuery] Re: question about each function

2009-04-14 Thread Leeoniya
i, too, am curious how to break out of a .each() loop. On Apr 14, 7:35 pm, jack wrote: > Hi, all > > See the following. > > $(input:text).each(function(){ >     >    if(something happened) return; >    --- >    --- > > }) > > I found the 'return' only exit form a particular input element. An

[jQuery] Re: event delegation - great, but how does one trigger the handlers through code?

2008-11-23 Thread Leeoniya
yay! On Nov 23, 4:00 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > Nice. Haven't looked thorougly at the plugin, but it seems all you > have to do is: > > $('table td:eq(x)').bubble('click'); > > On Nov 23, 6:36 pm, Leeoniya <[EMAIL PROTECTED]&g

[jQuery] Re: event delegation - great, but how does one trigger the handlers through code?

2008-11-23 Thread Leeoniya
> > Haven't tested this though. > > > > JK > > > > -Original Message- > > > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > > > Behalf Of ricardobeat > > > Sent: Saturday, November 22, 2008 7:43 AM > > &

[jQuery] Re: event delegation - great, but how does one trigger the handlers through code?

2008-11-21 Thread Leeoniya
;    var cell = e.target; >    do_something(); > > } > > var cell = table.find('td.eq(8)'); > selectCell.apply(table[0],[{target:cell[0]}]); > > JK > > -Original Message- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On >

[jQuery] event delegation - great, but how does one trigger the handlers through code?

2008-11-21 Thread Leeoniya
During event delegation, handlers are registered higher in the DOM tree and then filtered when the event is triggered. This is great if you have 2000 td/th cells, you can attach a listener to tbody and filter down. But would i trigger the event programatically? Since the handler isnt actually regi

[jQuery] how to prevent default action on SELECT "multiple" elements in IE?

2008-04-21 Thread Leeoniya
i'm trying to find a way to make a multiple SELECT element more intuitive to use by removing the need to use CTRL. all that you need is click once to select, click once to deselect. the simplest thing i could come up with is this: $("select[multiple] option").mousedown(function(){this.selected =

[jQuery] Re: bind() and thousands of elements - inline or extrnal?

2008-03-31 Thread Leeoniya
with the Listen plugin i have something like this: $("tbody").listen("click", "td", function(e) { $(this).addClass("edit").html(""); $("input", $(this)).each(function() {$(this).focus()}); }) is it appropriate to use $(this).addClass instead of $(e.target).addClass inside the handler? it se

[jQuery] Re: bind() and thousands of elements - inline or extrnal?

2008-03-31 Thread Leeoniya
i did the event delegation by hand and it's pretty easy. ("tbody").click(myHandler); function myHandler(e) { var e = e || window.event; var elem = e.target || e.srcElement; if (elem.nodeName.toLowerCase() == "td") { // do stuff } } however, the jQuery "Listen" plugin is much more p

[jQuery] Re: bind() and thousands of elements - inline or extrnal?

2008-03-30 Thread Leeoniya
can get to the clicked cell via e.target. > > > --Klaus > > > On Mar 28, 5:25 pm, Leeoniya <[EMAIL PROTECTED]> wrote: >> i need to bind a click function to several thousand table cells. would >> making >> an external function be better than specifyi

[jQuery] bind() and thousands of elements - inline or extrnal?

2008-03-28 Thread Leeoniya
i need to bind a click function to several thousand table cells. would making an external function be better than specifying an anonymous one inline?...i'm afraid that with the inline version it would make as many function instances as there are table cells...correct me if i'm wrong. thanks, Leo