-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
  • 79,297
  • 15
  • 120
  • 134
2

In javascript

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

In jquery

$(window).resize(function() {
     // Do what you want
});
Adil
  • 146,340
  • 25
  • 209
  • 204
0

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

Jonathan M
  • 17,145
  • 9
  • 58
  • 91
0

you can use window object, resize event:

$(window).resize(function(){
  ...
})
Ram
  • 143,282
  • 16
  • 168
  • 197
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,431
  • 43
  • 36