I'm using a script that an EE gave me and it works fine in FF, but i just tried it in IE and it doesn't scroll to the top.
The desired behavior is to have the top of the picture in the div to be at the top of the browser window.
Below is the JS code, and then the <div> in question
<script type='text/javascript'>
function findTopPos(obj)
{
var curtop = 0;
if (obj.offsetParent) {
do {
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
}
return curtop;
}
document.body.scrollTop = document.documentElement.s
crollTop = findTopPos(document.getEle
mentById('
flashconte
nt'));
</script>
<div id='flashcontent'><img src='image/image-loading.g
if'> etc.
</div>
any advice on how i can get this to work in IE 6 & 7 ? (FF, Opera, Safari for windows all work fine)
Start Free Trial