Начало
Сообщения
Баннер Rotater
Изменение баннера изображения на лету. Нет необходимости перезагружать страницу.
JavaScript Messages: Баннер Rotater
<!-- TWO STEPS TO INSTALL BANNER ROTATER: 1. Copy the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin var mfBanners = [ ['http://www.banner1-url-here.com', 'http://imageserv.imgis.com/images/Ad13700St1Sz1Sq1_Ban1.gif'], ['http://www.banner2-url-here.com', 'http://imageserv.imgis.com/images/Ad13189St1Sz1Sq5_Ban10.gif'] ]; var mfIe = false; if( document.all) { mfIe = true; } var mfBannerIndex = 0; function mfBannerChange() { var htmlString = '<a target="_blank" href="'+mfBanners[mfBannerIndex][0]+'"> <img border="0" src="'+mfBanners[mfBannerIndex][1]+'"></a>'; if( mfIe) { document.all.banner.innerHTML = htmlString; } else { document.layers["banner"].document.open(); document.layers["banner"].document.write( htmlString); document.layers["banner"].document.close(); } if(mfBannerIndex < mfBanners.length - 1) mfBannerIndex++; else mfBannerIndex = 0; } setInterval("mfBannerChange()", 5000); // End --> </script> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <div id="banner" style="position:absolute; top:300; left:171;"></div> <!-- Script Size: 1.74 KB -->