Im just trying to get to grips with javascript / ajax / jQuery so Im building a ticket system for my website.
Anyway, I have a table at the top of the page;
<table align="center" class="thinline" width="600" border="1" cellpadding="2" bordercolor="black">
<tr class="subtopic" style="font-size: 15px;">
<td><a onClick="javascript: ShowNewTickets()">New Tickets</a></td>
<td><a onClick="javascript: ShowYourTickets()">Your Tickets</a></td>
<td><a onClick="javascript: ShowPuplicTickets()">Public Tickets</a></td>
</tr>
</table>
When the page loads I want "New Tickets" to have the class "selected". If they hover the mouse over any of the unselected menus then it has a highlighted effect. Once they click onto another link the "selected" class will be removed from the other TD and added to the new TD.
I have tryed onmouseover and onmouseout to do the highlight effect but it messes up when it comes to the link which is already highlighted.
I have also tryed,
$('.off').live('mouseenter', function() {
if ($(this).hasClass('selected') == false) {
$(this).removeClass('off').addClass('highlighted');
}
});
But that then keeps the TD highlighted.
Thanks for reading.
highlighted.aelements. The:hoverselector will work on all browsers (even IE6).