-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
  • 76,636
  • 14
  • 118
  • 132
2

In javascript

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

In jquery

$(window).resize(function() {
     // Do what you want
});
Adil
  • 139,325
  • 23
  • 196
  • 197
0

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

Jonathan M
  • 16,131
  • 8
  • 49
  • 88
0

you can use window object, resize event:

$(window).resize(function(){
  ...
})
undefined
  • 136,817
  • 15
  • 158
  • 186
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,195
  • 40
  • 35