سلام ،
اون سايت dk-arta.com از سيستم تبليغاتي اين سايت استفاده کرده و تبليغات دست خودش نيست:
http://www.parsads.com
با اين کد که آموزشش هم همونجا هست، با هر بار رفرش شدن صفحه بنر به صورت تصادفي عوض ميشه:
http://www.javascriptcity.com/scripts/img/simage2.htm
يادت باشه تعداد تبليغاتت رو در دستور get_random(5) و new Array(5) تاثير بدي.
البته کدي هم که دوستمون chimikhay معرفي کردند کد خوبي بود و مشکلي نداشت. شما گفتي براي بيشتر 4 بنر کار نميکنه ولي من 5 تا بنر گذاشتم . به تغييرات بيشتر توجه کن .
ضمنا اين کد با فايرفکس من مشکل داشت.
کد:
<!--Powered javascript code by www.javacity.co.sr-->
<script language="JavaScript">
<!-- Hide from old browsers
var i = 1;
//This is where you load your banners change logo220.Gif to your banner name
banner1= new Image();
banner1.src = "http://www.javacity.co.sr/logo220.gif";
banner2 = new Image();
banner2.src = "http://www.javacity.co.sr/anim44.gif";
banner3 = new Image();
banner3.src = "http://www.javacity.co.sr/baneratr.gif";
banner4 = new Image();
banner4.src = "http://www.javacity.co.sr/baneratr.gif";
banner5 = new Image();
banner5.src = "http://www.javacity.co.sr/baneratr.gif";
//This where you make your links for the banners banners1 is linked to links[1]
links = new Array
links[1] = "http://www.javacity.co.sr/domain.htm"
links[2] = "http://www.namafilm.com"
links[3] = "http://www.isbps.com/"
links[4] = "http://www.ahwazserver.net/"
links[5] = "http://www.nabi.ir/"
//This will show up on the status bar when the mouse is moved over the banner
description = new Array
description[1] = "DOMAIN NAD HOSTING BY SONY CARD 20"
description[2] = "BEST SITE ...... Click Here"
description[3] = "Tozihat site"
description[4] = "ahwaz server"
description[5] = "nabi.ir"
function startTime(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
closeTime=hours*3600+mins*60+secs;
closeTime+=11;
Timer();
}
function Timer(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
curTime=hours*3600+mins*60+secs
if (curTime>=closeTime){
if (i < 5){
i++;
document.banner.src = eval("banner" + i + ".src");
}
else{
i = 1;
document.banner.src = eval("banner" + i + ".src");
}
startTime();
}
else{
window.setTimeout("Timer()",1000)}
}
function clickLink(){
top.location = links[i]
}
function descript(){
window.status = description[i]
}
// -->
</script>
</head>
<body BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#000080" ALINK="#000080" onLoad="startTime();">
<h2 align="center">Exchange Banner</h2>
<a target="_blank" href="#" onClick="clickLink(); return false;" onMouseOver="descript(); return true;" onMouseOut="window.status=''">
<p align="center">
<img src="http://www.javacity.co.sr/logo220.gif" href="http://www.javacity.co.sr/domain.htm" border="0" name="banner" width="468" height="60"></a><br>
</p>
<p align="center"> </p>
</body>
</html>
<!--Powered javascript code by www.javacity.co.sr-->
نبي