junkieslosa.blogg.se

Js onresize
Js onresize







Let us see an example of resizing windows with using an. Given below are the examples of JavaScript onresize: Example #1 Below is the output after resizing the page. To check it you can just minimize your browser window, the Event will be captured and the count will increase. But when the window is resized then the counter will increase. When the first time program is run, then above output will be displayed.

js onresize

In addition to this we have some more functions for resizing. It signifies that this function is calling onresize whenever the window is being resized. Here, in this function whenever the window is resized the count is incremented. As mentioned above the onresize function takes the user defined function as a parameter and then performs its function. We have then declared a variable x which will keep a count of the resizing.

js onresize

This function is calling the myResizeFunction(). The script that follows contains the onresize function.

js onresize

Here in the body we are printing the count of how many times the window is resized. This example helps in resizing an existing window and also keeps a count of it.ĭocument.getElementsByTagName("BODY").onresize = function() ĭocument.getElementById("demo").innerHTML = txt The working of the onresize function is very easy.









Js onresize