-2

Possible Duplicate:
Javascript window resize event

I want to get an event which is triggered when a user change the size of the actual window.

Any idea to do this ?

Community
  • 1
  • 1

5 Answers5

2

Try,

$(window).resize(function() {
  //Your code
});
Selvakumar Arumugam
  • 78,145
  • 14
  • 119
  • 133
2

In javascript

window.onresize = function(event) {
 // Do what you want
}

In jquery

$(window).resize(function() {
     // Do what you want
});
Adil
  • 143,427
  • 25
  • 201
  • 198
0

Look at the resize event: http://api.jquery.com/resize/

Jonathan M
  • 16,775
  • 9
  • 55
  • 91
0

you can use window object, resize event:

$(window).resize(function(){
  ...
})
Ram
  • 140,563
  • 16
  • 160
  • 190
0
$(window).resize(function() {
    alert("you've resized the window");
});

The resize event is sent to the window element when the size of the browser window changes

CodeOverRide
  • 4,343
  • 42
  • 36