[jQuery] Re: hover question

2008-10-03 Thread Brad
I'll check out livequery. On Oct 2, 6:19 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > The livequery plugin (http://brandonaaron.net/docs/livequery/) might > help you. You only bind the hover function once for a selector, and > all TR's subsequently added to the tables will have the event covered

[jQuery] Re: hover question

2008-10-03 Thread Brad
That doesn't work in my case, but thanks again for the recommendation. I should note that the code // Insert HTML row into table var tbody = $('').appendTo('#' + target_id + ' table'); tbody.attr('id','id-' + row.shipment_id); // This will highlight a tbody's rows on mouseEnter. // The orig

[jQuery] Re: hover question

2008-10-02 Thread ricardobeat
The livequery plugin (http://brandonaaron.net/docs/livequery/) might help you. You only bind the hover function once for a selector, and all TR's subsequently added to the tables will have the event covered with no need to bind it again. And just so you know, this tbody.hover(function () {

[jQuery] Re: hover question

2008-10-02 Thread Brad
Leonardo, I looked at my actual code again and wondered what would happen if I bound the hover at the end of the loop. Your recommendations partially work if I do that. Since each tbody can have a variable number of rows, my intent is to highlight all rows when hovered. Your examples only highlig

[jQuery] Re: hover question

2008-10-02 Thread Leonardo K
Try this: $(tbody).find('tr').hover(function () { $(this).addClass('hovered'); }, function () { $(this).removeClass('hovered'); }); On Thu, Oct 2, 2008 at 16:39, Brad <[EMAIL PROTECTED]> wrote: > > Leonardo, > > I should have shown some more code. In my original example, tbody i

[jQuery] Re: hover question

2008-10-02 Thread Brad
Leonardo, I should have shown some more code. In my original example, tbody is a reference to an jQuery object. I'm working with a page that has many tables. Each table can have many elements. The number of rows in each can vary, but in all case there is more than 1. Unfortunately the site is

[jQuery] Re: hover question

2008-10-02 Thread Leonardo K
$('tbody tr').hover(function () { $(this).addClass('hovered'); }, function () { $(this).removeClass('hovered'); }); On Thu, Oct 2, 2008 at 14:46, Brad <[EMAIL PROTECTED]> wrote: > > This isn't so much about hover, but about the selectors I've had to > use within its 'over' and 'out' func