Geniuses, Is this possible? Please help as my jQuery javascripting is bad.
I need to get the height of a div, which is dynamically created (so has auto height by default) – the dynamic tweet content is also generated by javascript, which I hope isnt causing issues.
See my dynamic div…
<div id="tweet-area"></div>
I then need to plant the div#tweet-area height into the script below…
$("#sidebar-wrapper").css({ bottom: " + variable here + " });
So this was my attempt, but not its quite working…
var tweetheight = document.getElementById('tweet-area').offsetHeight;
$("#sidebar-wrapper").css({ bottom: " + tweetheight + " });
Any advice would be hugely helpful thanks.
Josh
UPDATE
This is the script that works – loaded after the tweet script
var tweetheight = $("#tweet-area").height();
$("#sidebar-wrapper").css({ bottom: tweetheight});
Thank you all!
maybe
$("#sidebar-wrapper").css("bottom", tweetheight);would do it?Has worked for me in getting the height of an element ^