Answers for "scale down elements with window resize"

0

window resize done

function resizedw(){
    // Haven't resized in 100ms!
}

var doit;
window.onresize = function(){
  clearTimeout(doit);
  doit = setTimeout(resizedw, 100);
};
Posted by: Guest on November-09-2020
0

get window size on resizing

useEffect(() =>{
    let windowLength = document.documentElement.clientWidth || window.innerWidth;
    setWindowSize(windowLength);
  },[])
  console.log("onload is calling",windowSize);
  window.onresize= ()=>{
  let windowLength = document.documentElement.clientWidth || window.innerWidth;
  setWindowSize(windowLength);
  }
Posted by: Guest on December-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language