Scroll in an Iframe

More Scrolling Examples

Use the following script to scroll the contents of an Iframe, this script is placed in the document loaded into the Iframe

<script type="text/javascript">
<!--
var step=2

function init(){
document.getElementById("oDIV").style.top=5
height=400 // document.getElementById("oDIV").offsetHeight
scroll()
}

function scroll(){
document.getElementById("oDIV").style.top=parseInt(document.getElementById("oDIV").style.top)-step
if(parseInt(document.getElementById("oDIV").style.top)<-height){
document.getElementById("oDIV").style.top=80
}
timer=setTimeout("scroll()",50)

}

window.onload=init
// -->
</script>

<DIV id=oDIV style="position:absolute; left:0px; top:10px width:100%" onmouseover="clearTimeout(timer)" onmouseout="scroll()">CONTENTS<DIV>


Example using my Window Scroll H script

Back Next
Previous Image 1 Image 2 Image 3 Image 4 Image 5 Next