Jump to content

Page refresh when browser resized


garywhitling

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

 

Link to comment
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 🙂

Link to comment
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.

×
×
  • Create New...