Jump to content
Sign in to follow this  
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...