How to use Event Resize() Method in JQuery

In this article I am going to explain about event resize() method in jquery
  • 2006

jQuery Event Resize() Method

jquery resize event occurs when any change in window browser and resize() method will be executed. Its defined what done at the time of when event occurs.

Syntax

$(document).resize()

 

Example

 

<html>

<head>

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript">

        mm = 0;

        $(document).ready(function () {

            $(window).resize(function () {

                $("h1").text(mm += 1);

            });

            $("button").click(function () {

                $(window).resize();

            });

        });

    </script>

</head>

<body>

    <p>

        Resize Time<h1 style="color: Red">

            0</h1>

    </p>

    <p>

        Resize for browser window</p>

    <button>

        click me</button>

</body>

</html>

Output

resize.jpg

You may also want to read these related articles: here
 
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.