<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da" lang="da">
<head>
<title>Javascript banner rotation</title>
<script type="text/javascript">
<!-- Dette script og mange flere -->
<!-- findes hos http://www.html.dk -->
<!-- Start
bannerpics=new Array;
bannerurls=new Array;
bannerpics[1]="banner1.gif";
bannerurls[1]="http://www.html.dk/tutorials";
bannerpics[2]="banner2.gif";
bannerurls[2]="http://www.html.dk/artikler";
bannerpics[3]="banner3.gif";
bannerurls[3]="http://www.html.dk/scripts";
bannerpics[4]="banner4.gif";
bannerurls[4]="http://www.html.dk/faq";
bannerpics[5]="banner5.gif";
bannerurls[6]="http://www.html.dk/nyhedsgrupper";
// Nye bannere kan indsættes her
// Følg blot samme form som for de ovenstående bannere
function ShowBanner() {
num = Math.random();
num = 1 + ( num * ((bannerpics.length - 1)-1));
num = Math.round(num);
document.write("<div><a href='" + bannerurls[num] + "'>");
document.write("<img src='" + bannerpics[num] + "' border='0' ");
document.write("alt='Click here to find out more!'>");
document.write("</a></div>");
}
// Slut -->
</script>
</head>
<body>
<-- Bannervisning start -->
<script type="text/javascript">
ShowBanner();
</script>
<-- Bannervisning slut -->
<h1>På denne side roteres bannere</h1>
</body>
</html>
source : html.dk under scripts javascripts