kvnmck18 Posted September 2, 2008 Share Posted September 2, 2008 I'm using jQuery to load() external content that has a wrap() that will fadeIn() as a <div/> overlay. I am trying to get the height() of this wrap but it's coming up as "0".If I give it a fixed height in css it works -- BUT -- I can't give it a static height because the height needs to be relative to the content within (from the external file).I'm not sure how to fix this... It might be because the script is reading the "height" before the external content is actually loaded... but I'm not sure how to no make this happen.Suggestions? Has any dealt with this issue? Link to comment Share on other sites More sharing options...
kvnmck18 Posted September 2, 2008 Author Share Posted September 2, 2008 Here's an example I saw of someone else that was having the same issue (this is how you can easily reproduce the error) var x = $("<span>sjdafklasdjfljsdalf<br/><br/>dsfasdfasdf</span>").css('height', 250); x.height(); //0 x.css("height"); //250px alert(x.height()+" "+x.css("height")); The height should not be zero but the height of all those lines of "content". How can I show the height()? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 2, 2008 Share Posted September 2, 2008 It sounds like the element isn't being rendered before you get the height. Is there a way to force the element to get rendered before you check the height? I haven't used jQuery for much. Link to comment Share on other sites More sharing options...
kvnmck18 Posted September 4, 2008 Author Share Posted September 4, 2008 Not that I know of. hmm(no one on this forum is familiar with jQuery) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.