Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expandable jQuery content opens when reloading

I built in a jQuery collapsible plugin into my fixed header. (You can click the button in the right upper corner to open it)

My problem is as following, when I open the page, reload or click on a link it automatically opens for a second. I would like it stops doing that and instead only opens when someone actually clicks on the button.

I don't know which part of my code to add here so I uploaded both files.

Here is the code to the php file

Here is the code to the jQuery file

I'm sorry for the inconvenience. I am new to this website and I just started building my own website but I'm willing to learn.

Regards

like image 673
dejn Avatar asked Nov 12 '22 17:11

dejn


1 Answers

Try setting the container that holds the content to display:none in your css file to begin with.

Then when the button is clicked change the display value. You may not need to change the display value here as the jQuery which activates and shows it just now may work fine.

like image 70
Billy Moat Avatar answered Nov 15 '22 05:11

Billy Moat