HTML, css, script, MySQL :: script
Ротатор банеров
Обновите страницу - картинка будет меняться
<script type="text/javascript">
var mycrib = [];
mycrib[0] = '<a href="laska-samp.biz/articles/html/krtn" target="_blank" rel="nofollow"><img src="/images/kartinka/png_1.jpg" alt="название баннера" width="300" height="250"></a>'
mycrib[1] = '<a href="laska-samp.biz/articles/html/krtn" target="_blank" rel="nofollow"><img src="/images/kartinka/png_2.jpg" alt="название баннера" width="300" height="250"></a>'
mycrib[2] = '<a href="laska-samp.biz/articles/html/krtn" target="_blank" rel="nofollow"><img src="/images/kartinka/png_3.jpg" alt="название баннера" width="300" height="250"></a>'
var x = 0;
function rotate(mycrib) {
while (x < mycrib.length) {
var sort = Math.floor(Math.random() * mycrib.length);
if (mycrib[sort] != 0) {
document.getElementById('adspace').innerHTML = (mycrib[sort]);
mycrib[sort] = 0;
x++;
}
}
}
</script>
<script>
#adspace {
}
#adspace img {
}
</script>
<div id="adspace">
<script type="text/javascript">
rotate(mycrib);
</script>
</div>
|
|
|