Using a 'sticky footer', I need to have the bottom padding on the content div equal to the footer height.
I would like to use jQuery to grab the footer height and apply that value to the content div bottom padding value.
Hope t开发者_运维问答hat makes sense!
Thanks
var height = $('#footer').height();
$('#content').css('padding-bottom',height+'px');
I think this is the solution to your problem
var height = $('#footer').height();
$('.other').css('paddingBottom', height);
Could you paste some code? :)
<script type="text/javascript">
$(document).ready(function() {
var footerheight = $('#footer').height();
$('#contentarea').css('padding-bottom',footerheight+'px');
});
</script>
精彩评论