spankmaster79
spankmaster79

Reputation: 22203

Firefox maximize doesn't trigger resize Event

I try to catch resize events with jquery and the

$(window).resize(function() { }

Everything works fine, except when I use the maximize Button in Firefox, the event is not thrown.

Is there something wrong here?

Upvotes: 17

Views: 17409

Answers (3)

user1185551
user1185551

Reputation: 217

I ran into the same problem with my project, and had to find out that the CSS transition was causing the issue.

So I changed the CSS transition from ALL to only the shadow (thus the change in the width of the div wasn't "animated" any more) and then maximizing the browser window, combined with window.resize() was working as expected!

Upvotes: 4

lcapra
lcapra

Reputation: 1550

Seems not working because it takes a bit to maximize I think, this works for me:

$(window).resize(function() {
  console.log('resize');
  setTimeout(function() {
    console.log('resize me later');
  }, 150);
});

Upvotes: 26

wesbos
wesbos

Reputation: 26317

$(window).resize(function() { 
   console.log('resize!');
});

This works in FF5 / osx

Upvotes: 4

Related Questions