banner går i stå
Hej Jeg har lånt denne kode til banner rotation her på eksperten...det virker som om den går i stå når den har kørt lidt. Nogen der kan se hvad der er galt ?<div id="Layer1" style="position:absolute; width:156px; height:183px; z-index:1">
<!-- Start: ligHTCC Banner Rotator -->
<script language='JavaScript'> <!--
browserOk = false;
if ( (parseInt(navigator.appVersion)>=4 )
|| ( navigator.appName == "Netscape" ) ) {
browserOk = true;
} else {
alert("Sorry, Your browser do not support\n"
+"lightcc's banner rotator javascript");
};
// some browsers (like Internet Explorer 3)
// do not support imageswitching.
// setup banner rotator
//
var imgWidth = 156; // width of all the banners
var imgHeight = 183; // height of all the banners
var nrURLs;
banner1 = "ban_dus.jpg";
banner2 = "ban_alea.gif";
banner3 = "ban_jakoba.gif";
banner4 = "ban_REN3I.gif";
banner5 = "ban_cara.gif";
banner6 = "laciebanner.jpg";
bannerMax = 6; // increase this nr if you add more banners
nrURLs = bannerMax
page1 = "http://members.tripod.com/~jakagg/";
page2 = "http://members.tripod.com/~ALEASWORLD/aleaspoem1.html";
page3 = "http://home.talkcity.com/MigrationPath/jakoba/";
page4 = "http://www.newwave.net/~renegade/";
page5 = "http://www.geocities.com/westhollywood/village/1161";
page6 = "http://ww2.netnitco.net/users/luvya/";
pageMax = 6; // increase this nr if you add more banners
if ( pageMax != nrURLs ) {
if ( nrURLs > pageMax ) nrURLs = pageMax;
alert("Javascript coding error !\n"
+"You must have the same number of\n"
+"of bannerURLs and pageURLs\n \n"
+"Only the " +nrURLs +" first images will be shown.");
};
shownURL = 2; // # banner currently shown
nextURL = 2; // # of next banner to be shown
nextPic = 0; // image object will go here
picID = 0; // local timekeeping variable
banFocus = false;
function getNextURL() {
nextURL = Math.round( (Math.random()*nrURLs) +0.5 );
nextPic = new Image (imgWidth,imgHeight);
nextPic.src = eval("banner"+nextURL);
};
if ( browserOk ) { getNextURL(); };
function getNextPic() {
if ( browserOk ) {
if ( nextPic.complete == true ) {
//alert ( nextPic.src );
document.images.pic1.src = nextPic.src;
shownURL = nextURL;
getNextURL();
picID = setTimeout('getNextPic()',10000);
if ( banFocus ) showURL(true);
} else {
//alert ( "waiting for "+nextURL );
picID = setTimeout('getNextPic()',1000);
};
};
};
function goThere() {
top.location = eval("page"+shownURL);
};
function showURL(bool) {
banFocus = bool;
if ( bool == true ) {
top.self.status = eval("page"+shownURL);
} else {
top.self.status = "";
};
};
// --> </script>
<center>
<a href="java script:goThere();" onmouseover="showURL(true); return true;"
onmouseout="showURL(false); return true;"><img src="ban_alea.gif" width=156 height=183 name="pic1" alt="Banner Slide Show" border=0 hspace=0 vspace=0 /></a>
<script language='javascript'>getNextPic()</script>
<!-- End: ligHTCC Banner Rotator -->
</center>
</div>
