[jQuery] Re: window resize event causes IE6 IE7 to hang

2008-04-04 Thread SeanR

Thanks Charles  Jonathan,

I can't show the page yet as it is still under wraps but I'll try out
your suggestions and report back.

Kind regards

Sean


[jQuery] Re: window resize event causes IE6 IE7 to hang

2008-02-21 Thread Jonathan Sharp
Hi Sean,

I'm guessing what's happening is as you resize the div to the height of the
window - 270 it expands the document height which triggers another resize.
Do you have a URL to this page?

Cheers,
-Jonathan


On 2/21/08, SeanR [EMAIL PROTECTED] wrote:


 Hi all,

 I'm using $(window).resize() to adjust a div height on the fly.


 I've found that rapidly changing the window size causes IE6  IE7 to
 hang
 - I guess because too many events are being fired for IE to cope?


 Here's my code :


 function content_resize() {
var w = $( window );
var H = w.height();
$( '#content' ).css( {height: H-270} );
}

 $(document).ready(function() {
$( window ).resize( content_resize );
content_resize();
 });


 I'm using jquery 1.2.2 and the dimensions plugin. I've also tried the
 wresize plugin which addresses duplicated resize events in IE but both
 cause
 the same hang when browser window altered quickly.

 Anyone else seen this? Are there any workarounds?

 [Apologies for repost, my first got lost in another thread]

 Regards
 Sean
 sean ronan
 activepixels
 office :   01245 399 499
 email :  [EMAIL PROTECTED]
 web :activepixels.co.uk
 Activepixels is a limited company registered in England and Wales.
 Registered number: 5081009.
 Registered office: Suite SF8, The Heybridge Business Centre, 110 The
 Causeway, Maldon, Essex, CM1 3TY.





[jQuery] Re: window resize event causes IE6 IE7 to hang

2008-02-21 Thread polyrhythmic

  I've found that rapidly changing the window size causes IE6  IE7 to
  hang
  - I guess because too many events are being fired for IE to cope?


Exactly.  Try using a setTimeout so that the resize only fires every
100ms or so, you can vary it depending on how fluid you want the
animation vs how much CPU your code will eat.  Let's see... I know
it's been discussed on this list before...
...[ search ]...Aha:
http://groups.google.com/group/jquery-en/browse_thread/thread/4a00d513c63f5c00
http://groups.google.com/group/jquery-en/browse_thread/thread/3308d5cb71c77456

You can see how I've implemented it in my (beta) Caption Plugin here:
http://code.doublerebel.com/jQuery/jquery.caption.beta.js

HTH

Charles