showing results for - "js reload page 1024 breakpoint"
Dinah
30 Apr 2019
1var ww = window.innerWidth, limit = 1025;
2var refresh = function() {
3  ww = window.innerWidth;
4  var w = ww < limit ? (location.reload(true)) :  ( ww > limit ? (location.reload(true)) : ww=limit );
5}
6var tOut;
7window.onresize = function() {
8  var resW = window.innerWidth;
9  clearTimeout(tOut);
10  if ( (ww > limit && resW < limit) || (ww < limit && resW > limit) ) {
11    tOut = setTimeout(refresh, 100);
12  }
13};