Hi and i hope youll be able to help me.
Im writing a little script thats supposed to show a sublist when a link is clicked and hide all other sublists at the same time.
And it works fine except of course in IE8... When i click the link there it just expands a bit and then hides again.
I tried everything i could think of.. i tried commenting out everything except for the line thats supposed to show it and changing the method to show(). That shows it, but when using slideToggle() or toggle() there still the same problem.
Link of the page is
http://www.kaboomunlimited.com/mamamia. To see the effect just click any of the links in the left menu that have > sing appended.
also my code:
- $(document).ready(function(){
//hide all submenus on startup
$("ul.wpsc_categories li ul").hide();
//append > to all submenus
$("ul.wpsc_top_level_categories li ul").parent().children("a.wpsc-cat-item").append(">");
$("ul.wpsc_top_level_categories li ul li").children("a").each(
function(){
if($(this)[0].href == window.location)
{
$(this).parent().parent().slideDown('fast');
}
}
);
$("ul.wpsc_top_level_categories li ul").parent().children("a").click(function(){
var vis = $(this).parent().children("ul")[0].style.display;
//first hide all menus
$("ul.wpsc_top_level_categories li ul").slideUp('fast');
//slidedown only if this item was previously also hidden
if(vis == "none")
{
$(this).parent().children("ul").clearQueue().slideDown('fast');
}
return false;
});
});