I have make a hide/show button for my site’s header, but I have this “issue”. If user load my site for first time, or after refresh, this button needs to click two times for work. But only for the first time. Then it works normally! Any idea why is this happening?
Live example at the comment below. Thank you in advance!!!
The js code is:
if you alert the value of sheader_1 the first time you load the page, result is an empty string, so your code won’t do anything (it will jump to the else statement).
One way to make it work would be: