Her er et eks på hele koden:
<html>
<body>
<script LANGUAGE="Javascript">
yspan = 250;
function scrollBannerDown()
{
if(yspan > 0)
{
yspan = yspan - 35;
if(yspan <= 0)
{
yspan = 0;
document.getElementById('scrolldownbanner').style.top = 97
};
document.getElementById('scrolldownbanner').style.clip = 'rect(' + yspan + ' auto auto auto)';
if(yspan > 0)
{
document.getElementById('scrolldownbanner').style.top = parseInt(document.getElementById('scrolldownbanner').style.top)+35;
};
setTimeout("scrollBannerDown()",100);
};
else
{
setTimeout("scrollBannerUp()",3000);
};
};
function scrollBannerUp()
{
if(yspan < 250)
{
yspan = yspan + 35 ;
if(yspan >= 250)
{
yspan = 250;
document.getElementById('scrolldownbanner').style.top = -154};
document.getElementById('scrolldownbanner').style.clip = 'rect(' + yspan + ' auto auto auto)';
if(yspan < 250)
{
document.getElementById('scrolldownbanner').style.top = parseInt(document.getElementById('scrolldownbanner').style.top)-35;
};
setTimeout("scrollBannerUp()",50)
};
else
{
mayclick = 1;
};
};
</script>
<SCRIPT LANGUAGE="Javascript">
document.onload = setTimeout("scrollBannerDown()",2500);
</SCRIPT>
<script language="JavaScript1.2">
//a = eval((document.body.clientWidth-760)/2)+135;
//document.write ('<DIV ID=scrolldownbanner STYLE="top:-100px;left:'+a+'px;clip:rect(250px auto auto auto); position:absolute; width:490px; height:250px;">');
document.write ('<DIV ID=scrolldownbanner STYLE="top:-100px;left:100px;clip:rect(250px auto auto auto); position:absolute; width:490px; height:250px;">');
</script>
<a href="
http://www.eksperten.dk" target="_blank">
<img src="./hyttetur/06.jpg" border="0" width="490" height="250" alt="Banner">
</a>
<br>
<a onClick="scrollBannerDown();" HREF="#">
<img SRC="./hyttetur/01.jpg" HEIGHT="1" WIDTH="427" border="0" alt="Linje Billede">
<img BORDER="0" SRC="./hyttetur/02.jpg" border="0" WIDTH="62" HEIGHT="14" alt="Vis Reklame">
</a></div>
</body>
</html>
For at styre hvor den kommer kan du rette i tallene efter top og left. 0 punktet er center for top er midt i vinduet, da man har flytte DIV'en :
document.write ('<DIV ID=scrolldownbanner STYLE="top:-100px;left:100px;