Page 4 of 4

Posted: Wed Jun 13, 2007 3:54 pm
by RobertGonzalez
Kieran Huggins wrote:

Code: Select all

$(function(){
	$('.tree-navigation li').click(function(){
		$(this).toggleClass("branch-closed").toggleClass("branch-open").focus();
	});
	$('.tree-navigation ul').click(function(){
		return false;
	});
});
So I ran into a small issue with this code, and not knowing Jquery well has come to bite me square in me round arse.

This code works in IE and Firefox. But in Opera and Safari, it will toggle once, toggle twice, then stop toggling. Also, the link clicks are actually firing, so opening/closing a branch is actually loading that anchor that is in there. Any idea how I can stop that from happening? Thanks muchos in advance.