Sample JS code (not the most elegant, but it will work).
Code:
function divCalc(){
var bgHeight=150;
var obj = document.getElementById("rptr");
var oldHeight = obj.clientHeight;
if (oldHeight < bgHeight){
obj.style.height = bgHeight + 'px';
}else{
if (oldHeight % bgHeight != 0) obj.style.height = oldHeight + (bgHeight - (oldHeight % bgHeight)) + 'px';
}
}
window.onload = divCalc;
A div with id="rptr" is what I used to test, with a 150px image. I'm just posting the first thing I tried that worked, I'm sure it can be refined.
Bookmarks