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() {
>
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;
});
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
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
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
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
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
> > 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
> > &
; 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
>
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
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 =
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
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
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
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
15 matches
Mail list logo