In a table like this:

<table id="choices-table" border="1" width="75%">
<tr><th>Item</th></tr>
<tr id="row-1"><td>One</td></tr>
<tr id="row-2"><td>Two</td></tr>
<tr id="row-3"><td>Three</td></tr>
</table>

I want to highlight the rows when hovered. I also wan't to set a
different background color on the row when double clicked. I have the
following jquery code:

        $(document).ready(
                function() {

                        $("[EMAIL PROTECTED]'']").hover(
                                function(){ $(this).addClass('hilite'); },
                                function(){ $(this).removeClass(); });

                        $("[EMAIL PROTECTED]'']").dblclick(function(){
                                $(this).removeClass();
                                $(this).addClass('dblclckd');
                        });
                }
        );

Note: in the above selectors that is @class=<single quote><single
quote>

The hover is highlighting the rows. The double-click is changing the
row background. The problem is when if I hover over the previously
double clicked row. It loses its styling.

What I'd like to do is prevent the hover from acting on any row that
has been double clicked. I'm trying to do this based on the hovered
rows class, but that isn't working.

Ultimately, I'd also like to prevent the double clicked row from
running code if previously double clicked.

Reply via email to