ruby on rails - Jquery window height messed up -


i'm using jquery-rails 2.2.1 jquery 1.9.1 if open firebug , run $(window).height() height 921. if close , open firebug (same size) $(window).height() changes 1130 if try resize firebug window values

>>> $(window).height() 921 >>> $(window).height() 4276 >>> $(window).height() 6106 >>> $(window).height() 7326 

my firefox 21.0 , firebug 1.11.3.

i don't know happening imagine problem firebug, correct way window size (no document)? i'm using center div in middle of screen

$(document).ready(function(){    wsh = $(window).height();    wsw = $(window).width();    addsh = (wsh/2) - ($('#addsituation').height()/2);    addsw = (wsw/2) - ($('#addsituation').width()/2);        $('#addsituation').animate({'margin-top': addsh}, 1000); } 

the first time open div fine, if open , close firebug messes, if resize firebug goes way down. updated rails-jquery last version. there workaround? there way that?

note: div in file , load $(".mydiv").load(). $(document).ready inside div.

i need visible area height. if mess "page" height limited monitor size. resize event:

$("#layoutinside").css("min-height", ($("#showcontent").height() > $("#menu").height() ? $("#showcontent").height() : $("#menu").height()) + $(".footer").height() + 60) 

the problem window height , document height same.. 1008 height ok, want area can see in monitor not whole document area.

in pure js works

>>> window.innerheight 502 >>> $(window).innerheight() 1008 

regards.

make sure declare <!doctype html> before else. having same issue , worked me.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -