Avatar of Yuri Boyz
Yuri Boyz
Flag for Uganda asked on

Refresh page on browser resize

I am testing my website. To test the responsive menu I resize the browser and on certain size the mega menu hides and hamburger menu appears. In hamburger menu there is a search keyword textbox and submit button. But it will not work unless I refresh the page.

But if I directly open the website on mobile and tablet then it will work perfectly.

I have added several codes so that if user resize the browser then page reload code will run but thus not works also everytime.

Any solution for this?
MobilePHPJavaScript

Avatar of undefined
Last Comment
lenamtl

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Adam the 32-bit Aardvark

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Steve Bink

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Dave Baldwin

The browser does not notify the web page that the window has been resized.  You would have to be continuously checking the window size to know that.
Steve Bink

@Dave Baldwin: there's an event for that.  https://developer.mozilla.org/en-US/docs/Web/Events/resize
lenamtl

You should  rethink or fix your template instead.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck