tags:

views:

300

answers:

1

I have a simple vertical menu and I'm using the .toggle() function to expand/collapse the submenu. It works in FF and Safari, but not in IE. (none of the IE's)

I also have a very simple "slideshow" function also using jquery, and it seems to be working in all browsers.

Website is live: http://www.fastpartsauto.com

Code:

<script type="text/javascript">
$(document).ready(function(){

$("#menu h3").click(function(){
menu = $(this).parent('li').children('ul');
menu.toggle('normal');
});

$('#featured_list').innerfade({ 
speed: 'slow', 
timeout: '8000', 
type: 'sequence', 
containerheight: '290px' 
}); 

});
</script>

HTML is a simple UL but I can't post it because I'm a new user and only allowed 1 hyperlink.

+4  A: 

I think you're missing a var keyword

here you go

$("#menu h3").click(function(){
var menu = $(this).parent('li').children('ul');
menu.toggle('normal');
});
Aziz
damn! beat me to it - here's the demo to prove it - http://jsbin.com/alesa
Russ Cam
That reinforces the need to debug your app using something like FireBug.
gAMBOOKa
Also reinforces the need not to use toggle cos it's $hat...
daddywoodland
@daddywoodland - what should he use then?? o_O - I think toggle is very straight forward
fgualda87