I have a banner that varies in height based on the buttons, I'm not sure if that is bad design not have something concrete but the height is set to auto. I want to get this height so that I can base other dimensions based on the height of this banner.
I tried the following but the alert said null
<script type="text/javascript">
function getBannerHeight() {
var height = $('#banner').height();
alert(height);
}
getBannerHeight();
</script>
I'm looking at the .height documentation for jquery and I see as a sample this:
$( "#getp" ).click(function() {
showHeight( "paragraph", $( "p" ).height() );
});
So is it a notation problem? I mentioned javascript as any option is fine, whichever works.
-- update --
I guess this is a flawed way to do design. The idea was to take the resulting banner height which would vary in height due to the buttons inside, and then subtract this from the total window height as a base to the other dimensions. Which for this to work, the banner nor any other elements would exist and the dimensions would have to be calculated then assigned to be created on the screen... ehhh
At any rate my question was answered, thank you.