Prev Demo
jQuery
>
.Resize() - Attach Resize Event
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <style> #divResize{ color:Green; background-color:skyblue; width:1oopx; height:100px; } </style> </head> <body> <div id="divResize">This is Window. By resizing the window/Browser you can see the width of the window/browser in the page.</div> <script> $(window).resize(function () { $("#divResize").text("Window size is: " + $(window).width()); }); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output