Pages

Tuesday, January 12, 2021

To make html embed auto resize like media inquiries on New Google sites

 Put inside the embedded object on the New google sites

---------------------------------------------------------------------------------------------------------
<!DOCTYPE html>

<html>

<body id="body">


<p>This example uses the addEventListener() method to attach a "resize" event on the window object.</p>


<p>Try to resize the browser window.</p>


<p>Window size <span id="demo">0</span> </p>


<script>

window.addEventListener("resize", myFunction);

myFunction();

var x = 0;

function myFunction() {

var body = document.getElementById("body");

  document.getElementById("demo").innerHTML = body.offsetWidth;

}

</script>


</body>

</html>




No comments:

Post a Comment