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
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
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 () {
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
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
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
$('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
7 matches
Mail list logo