5 sekunder er lovlig kort tid at vise banneret i.
<script language=\'JavaScript\'> <!--
var debugOn = true; // for testing if you make changes
function debug ( str ) {
if ( debugOn ) debugOn = confirm( str );
};
browserOk = false;
if ( (parseInt(navigator.appVersion)>=4 )
|| ( navigator.appName == \"Netscape\" ) )
browserOk = true;
// some browsers (like Internet Explorer 3)
// do not support imageswitching.
// setup slideshow
//
var imgWidth = 120; // width of all the banners
var imgHeight = 120; // height of all the banners
var imgRude = \"occimages/rude120x120.gif\"; // usynligt billede i samme størrelse
var imgPath = \"occimages/\"; // path to images directory
function doPreload () {
with ( ligHTCC ) {
for (var i=0; 2>i; i++) {
if ( ( myPics.length>idx[i] ) &&( preload[i].complete ) ) {
idx[i]=idxNext++
if ( myPics.length>idx[i] ) {
preload[i] = new Image(imgWidth,imgHeight);
preload[i].src=imgPath+myPics[idx[i]]
} else
preload[i]=\"\"; // release Ram used for preload
}
};
idxMin=Math.min(idx[0],idx[1]);
if ( myPics.length>idxMin )
ligHTCC.preHandle = setTimeout(\"doPreload();\",100);
}
};
function rInt ( valu ) {
return Math.floor(Math.random() * valu);
};
function showPics () {
if (ligHTCC.idxMin>0)
document.images.pic1.src = imgPath+ligHTCC.myPics[rInt(ligHTCC.idxMin)]
ligHTCC.showHandle = setTimeout(\"showPics();\",ligHTCC.picDelay);
};
function makeLigHTCC () { // insert/remove pictures below
this.myPics = new Array (
\"bamse.gif\",\"birthe-kjaer.gif\",\"johnny-reimar.gif\",\"gnags.gif\",\"kim-larsen.gif\",
\"shu-bi-dua.gif\", \"travolta.gif\", \"lennoncav.gif\", \"hiroko-karaoke.gif\",
\"souvenirs.gif\", \"karaoke2.gif\", \"henning-staerk.gif\",
\"duet.gif\", \"elvis8.gif\", \"girlsing.gif\", \"karaoke1.gif\",
\"singing3.gif\",\"rude120x120.gif\"
);
this.picDelay = 1000; // used in showing the images
this.showHandle = 0;
this.idx = new Array ( 0, 1 );
this.preload = new Array ( new Image(imgWidth,imgHeight),
new Image(imgWidth,imgHeight) );
this.preload[0].src = imgPath+this.myPics[this.idx[0]];
this.preload[1].src = imgPath+this.myPics[this.idx[1]];
this.idxMin = 0;
this.idxNext = 2;
this.preHandle = 0;
};
if ( browserOk ) {
var ligHTCC = new makeLigHTCC();
ligHTCC.preHandle = setTimeout(\"doPreload();\",100);
ligHTCC.showHandle = setTimeout(\"showPics();\",1000);
};
var srcTxt = \"<p><IMG SRC=\'\" +imgRude +\"\' name=\'pic1\' BORDER=0 WIDTH=\"
+imgWidth +\" HEIGHT=\" +imgHeight +\" Align=\'right\' ALT=\'køb køb køb\'>\";
document.write( srcTxt );
// --> </script>
tilrettet fra
http://hjem.get2net.dk/Jakob.Aggernaes/javascript/javascript17.htmldu vil nok ønske at ændre billedstørrelsen i variableme imgWidth og imgHeight foroven
mvh JakobA