There is a dimensions plugin that gets the client height/width easier.
http://dev.jquery.com/browser/trunk/plugins/dimensions/dimensions.js?format=txt

Glen


On 3/13/07, Hrvoje Blažeković <[EMAIL PROTECTED]> wrote:

 When I trie with other elements that You suggested, then the functinality
in FF and Safari is broken, no class is added or remooved :(


I placed a $(document).ready function where it functions as it should. On
document load the style is added if the html is taller then 700px and it
works in all tested browsers (IE,FF & Safari)


$(document).ready(
function(){
var ys = $('html').height();
if(ys>700){
$('#wrap').addClass('over1024');
}
}
  );




This code works while the code in the for the resize() event does not work
in IE, it hangs the browser.


Hrvoje




On 13 ožu, 2007, at 13:41, Abel Tamayo wrote:

bet it's not recognizing the selector 'html'. Have you tried with document,
'body' or window?

On 3/13/07, Hrvoje Blažeković < [EMAIL PROTECTED]> wrote:
>
> Please, can someone tell me why IE hangs when executing this code?
>
>
> $(document).ready(
> function(){
> $(window).resize(
> function(){
> var ys = $('html').height();
> alert(ys);
> if(ys>700){
> $('#wrap').addClass('over1024');
> } else {
> $('#wrap').removeClass('over1024');
> }
> return false;
> }
> );
> }
>   );
>
>
>
>
>
>
> When the window is resized in IE the browser hangs, but other browsers
> (Fireworks, Safari) just do fine..
>
>
> Is there a simpler way to write this function?
>
>
> Thanks for your time
>
>
> Hrvoje
>
>
>
>  ====================
> Hrvoje Blažeković
> tel.:  048/220 418
> fax.: 048/220 417
> e-mail: [EMAIL PROTECTED]
> ------------------------------------
>
>
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/


 ====================

Hrvoje Blažeković

tel.:  048/220 418

fax.: 048/220 417

e-mail: [EMAIL PROTECTED]

------------------------------------



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to