determine screen height
..normally
1 2 var h = document.documentElement.scrollHeight;
..however in some cases (safari 3) you may have to find where something is on the screen and generate the actual screen size around that
1 2 if (($('lightbox_bottom').cumulativeOffset().top+30) > document.documentElement.scrollHeight) { 3 $('sBg').style.height=$('lightbox_bottom').cumulativeOffset().top+30+'px'; 4 } 5 else { 6 $('sBg').style.height=document.documentElement.scrollHeight+'px'; 7 }
30 being the height of the bottom element your using to judge.