Reputation: 2289
I've got two divs (#mosaicBlog and #mosaicAside). I've got #mosaicAside's CSS set to overflow hidden and want to set #mosaicAside to always be the height of #mosaicBlog (dynamic height page to page).
I thought this would work, but it does not seem to be working. I'm thinking it may just be a syntax problem.
$(function(){
var curHeight = parseInt($("#mosaicBlog").height());
newHeight = Math.ceil(curHeight/189) * 189 - 7;
alert(newHeight );
$("#blogAside").height(newHeight);
});
Any help would be appreciated.
Upvotes: 0
Views: 480
Reputation: 4908
try after loading document
$(document).ready( function() {
var curHeight = parseInt($("#mosaicBlog").height()),
newHeight = Math.ceil(curHeight/189) * 189 - 5;
$("#blogAside").height(newHeight );
});
Upvotes: 0