View Full Version : Resolved Keep First Menu Expanded On Load

10-12-2013, 03:23 PM


How do I keep the first one open(expanded) when the page loads?

Upon loading they all are collapsed. I would like to have the first one expanded.

So instead of this:

It would load the page like this:

Hopefully somebody could help me out, thanks!

10-12-2013, 05:19 PM
Add this:

$('.dt1 a').trigger('click');


$('.dt1 a').trigger('click');

But that might be too soon. If it is, add it here instead:


$palkit.animate({marginTop:'0px'}, 350, function(){
$(this).animate({marginTop:'25px'}, 400);});
$('.dt1 a').trigger('click');

The browser cache may need to be cleared and/or the page refreshed to see changes.

10-12-2013, 05:50 PM
Thank you so much for you help. You are the best!

The first code didn't work, but the second one worked like a charm. :)

Thought there are a few problems now, as you can see if you press the link above.
1. I believe there should be a small delay before the code is called.
2. The "Etusivu" -button (In english Front page) isn't active (Blue)

Is there a way to fix these problems and if there is could you please help me out.
Thank you again for helping me. I really and truly appreciate it.

Edit. Got the first problem solved by adding this code around the code you gave me.

setTimeout(function() {$('.dt1 a').trigger('click');},775);

10-12-2013, 08:47 PM
Using a timeout like that is fine.

To get the highlight, add the red code:

$('.dt1 a').trigger('click').css({opacity: 1});

Or, you can trigger the mouseover:

$('.dt1 a').trigger('mouseover').trigger('click');

Which you might like better because it's more gradual.

10-13-2013, 11:06 AM
Thank you again for all of your help! I would have never got it to work with out your help.