jQuery click event problem
Hey
I'm new to jQuery, and have a problem that I'm not sure can even be solved the way I want it to. I'd just like some input from those more in the know.
I have a <li> which contains a small table with some links in the cells. I am using jQuery so that when the <li> is clicked (anywhere), the next <li> in the list is revealed. That works fine.
My problem is that when either of the links within the first <li> is clicked, before navigating to the new page, the <li> animation begins as normal. Now I realise that this is normal behaviour as even though I am clicking the link, the link is part of the <li> which triggers the jQuery, so in fact 2 click events are happening.
Is there a way I can stop the jQuery click event when certain of the links are clicked?
In case you need it, my html (actually a php page) is:
echo "<li class='squadheader'>";
echo "<table>";
echo "<tr>";
echo "<td width=400><a href='#'>".$row['name']."</a></td>";
echo "<td width=100><a href='manage.php'>Manage</a></td>";
echo "<td width=100><a href='#'>View</a></td>";
echo "</tr>";
echo "</table>";
echo "</li>";
It is the 'Manage' link that I want to act normally and not invoke the li jQuery.
My jQuery code is:
$(function() {
$('#mysquads li.squadheader').click(function() {
$(this).next().slideToggle('slow');
});
});
Any ideas greatly appreciated.
Thanks
Neil