开发者

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, t开发者_StackOverflowhe event is not thrown.

Is there something wrong here?


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);
});


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

This works in FF5 / osx


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜