Skip to content

Instantly share code, notes, and snippets.

@chrdesigner
Created December 10, 2015 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrdesigner/5637d7f539e284d740b9 to your computer and use it in GitHub Desktop.
Save chrdesigner/5637d7f539e284d740b9 to your computer and use it in GitHub Desktop.
Script for reload only different Browser Width
//Create the VAR for get browser size
var windowWidth = $(window).width();
$(window).bind('resize', function(e) {
//Verification with my VAR windowWidth is different Window size
if(windowWidth != $(window).width()){
//Create a delay for reload
if (window.RT) clearTimeout(window.RT); window.RT = setTimeout(function() {
this.location.reload(false);
}, 200);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment