Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Window resize event using jQuery

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 372
    Comment on it

    Events are the strength of jquery. There are different types of events for different purposes in jquery such as click,change etc. We are going to discuss one of the events named resize. It will be applied on the window size change. It will call a function whenever window's size changes.

    Let us take a simple example:

    <html>
    <head>
    <script type="type/javascript">
    jQuery(function($){
    jQuery(window).resize(function(){
    jQuery("#window-msg").html("<div>" + $( window ).width() + "</div>");    
    });    
    });
    </script>
    </head>
    <body>
    <div id="window-msg"></div>
    </body>
    <html> 
    

    This example will show the width of the window whenever window's size changes.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: