Bug Tracker

Opened 10 years ago

Closed 10 years ago

#6720 closed bug (invalid)

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:
Blocked by: Blocking:

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 (1)

comment:1 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.