Jump to content
garywhitling

Page refresh when browser resized

Recommended Posts

Hi,

I was wondering if anyone knows of some code that can be added to "Refresh" the page or the main menu anytime the web browser is resized on a desktop. I don't need this to happen when the site is being viewed on a mobile or tablet, only for the desktop view.

Basically, I have a problem with a menu layout that doesn't resize it's self correctly when the web browser is resized manually.

Any Suggestions?

Regards Gary

 

Share this post


Link to post
Share on other sites

if you no code, you can embed some hidden div's with unique ID's and assign the foundation "show-for" classes. then access it by ID in JS to see if it's active.. if it is you can trigger an event. :)

Share this post


Link to post
Share on other sites

Cheers Al and Noodleman,

Found this that looks like it would do https://www.sitepoint.com/jquery-refresh-page-browser-resize/

======================================================

//refresh page on browser resize
$(window).bind('resize', function(e)
{
  if (window.RT) clearTimeout(window.RT);
  window.RT = setTimeout(function()
  {
    this.location.reload(false); /* false to get page from cache */
  }, 200);
});

==================================================

However, not sure where to paste in

Noodleman like your idea of using hidden div's to control the desktop layout only 🙂

Share this post


Link to post
Share on other sites

I've used that strategy a number of times as the earlier versions of foundation don't have many JS features

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×