Thursday, July 26, 2012

Asp.net jQuery Page Resize Event Handler


The Page/Window Resize event can be handled using jQuery by adding a handler to the jQuery resize event as follows.

$(window).bind("resize", function(event) {
     // Add your code here.
});


Example

Note: Change the reference of the jQuery
jquery-1.7.2.js files to point to your local directory.

<
html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Page Events</title>
    <script type="text/javascript"
src="JavaScript/jquery-1.7.2.js"></script>
    <script type="text/javascript"
language="javascript">
    $(document).ready(function() {
        $(window).bind("resize", function(event) {
            alert('Window Resize');
        }); 
    });
    </script>
</head>
<body>
    
</body>

Search Flipkart Products:
Flipkart.com

No comments: