Bug Tracker

Modify

Ticket #6720 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

Delegate have a problem with mouse effects and table rowspan

Reported by: Lichon Owned by:
Priority: Milestone: 1.4.4
Component: unfiled Version: 1.4.2
Keywords: delegate mouse table Cc:
Blocking: Blocked by:

Description

I am using the basic code idea from  http://css-tricks.com/row-and-column-highlighting/ (currently unavailable). Full code below.

XHTML <table>

<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>

<thead>

<tr>

<th></th> <th></th> <th></th> <th></th> <th></th>

</tr>

</thead> <tbody>

<tr>

<td></td> <td></td> <td></td> <td></td> <td></td>

</tr> <tr>

<td></td> <td></td> <td></td> <td></td> <td></td>

</tr> <tr>

<td></td> <td></td> <td></td> <td></td> <td></td>

</tr>

</tbody>

</table>

CSS .hover { background-color: #eee; }

jQuery $("table").delegate('td','mouseover mouseleave', function(e) {

if (e.type == 'mouseover') {

$(this).parent().addClass("hover"); $("colgroup").eq($(this).index()).addClass("hover");

} else {

$(this).parent().removeClass("hover"); $("colgroup").eq($(this).index()).removeClass("hover");

}

});

I added a new column with rowspan and noticed the above jQuery code is off by index 1 when NOT hovering over the cell which begins the rowspan. My guess is that because of the rowspan jQuery doesnt count the cellspace there as used unless its the cell that contains the rowspan attribute. The issue does not appear when using colspan.

Change History

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

I added a new column with rowspan

It sounds like there is more code required to reproduce the problem. Please attach a file with the complete Javascript and HTML required. You may want to start a thread on the forum to make sure it is really a jQuery core bug and not a misunderstanding about the way the code works.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.