0

I am using this mega menu

What I would like is for one tab (the second tab) to be open when the page loads without someone having to hover over it first - I would still need it to change to the other tab contents if a different one is hovered though. I tried adding:

$(document).ready(function() {
    $('ul.menu li.fullwidth:first div.dropdown_fullwidth').css('left','0px');
});

which kept the content open but didnt have the tabs hover state nor did it change when i hover on another - can someone help me out here?

j0k
  • 22,600
  • 28
  • 79
  • 90
John
  • 989
  • 2
  • 16
  • 29

1 Answers1

0

I would just question why you need to pop open a dropdown like that? But probably something like would do the trick:

$("li:first div").show()

Edit:

Ok I see the issue sorry:

you'll need to take the hover css and apply it to the button with a .select class with the same styles then add:

$("li:first a").addClass("selected");

You'll then have to remove it on rollover of any of the other buttons:

$("li a").hover(function(){
   $("li:first a").removeClass("selected");
})

I'll be honest that's really hacky and horrible, but I not sure there is other way to apply it without a lot of re-writing of the CSS. I'd personally suggest considering why you want to do this a look for a better solution by considering your navigation structure.

DJ Forth
  • 1,518
  • 2
  • 18
  • 26