Показать сообщение отдельно
  #36 (permalink)  
Старый 17.12.2014, 10:37
Новичок на форуме
Отправить личное сообщение для alsgenie Посмотреть профиль Найти все сообщения от alsgenie
 
Регистрация: 16.12.2014
Сообщений: 3

Спасибо большое, но когда я добавил ссылки , у меня перестали меняться картинки. Может подскажите, что я не так сделал.
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<meta charset="utf-8">
<style type="text/css">
img{
width: 645px;
height: 353px;
}

a img{
cursor: pointer;
}


</style>
</head>

<body>
<div id="header" >
<img src="http://aksmoney.com/images/mag/1.png" id="img_1" style="position:absolute; width:645px; height:353px" />
<img src="http://aksmoney.com/images/mag/2.png" id="img_2" style="position:absolute; width:645px;opacity: 0; filter: alpha(opacity=0); height:353px " />
<img src="http://aksmoney.com/images/mag/3.png" id="img_3" style="position:absolute; width:645px;opacity: 0; filter: alpha(opacity=0); height:353px " />
<img src="http://aksmoney.com/images/mag/4.png" id="img_4" style="position:absolute; width:645px;opacity: 0; filter: alpha(opacity=0); height:353px " />
<img src="http://aksmoney.com/images/mag/5.png" id="img_5" style="position:absolute; width:645px;opacity: 0; filter: alpha(opacity=0); height:353px " />
<img src="http://aksmoney.com/images/mag/6.png" id="img_6" style="position:absolute; width:645px;opacity: 0; filter: alpha(opacity=0); height:353px " />
<img src="http://aksmoney.com/images/mag/7.png" id="img_7" style="position:absolute; width:645px;opacity: 0; filter: alpha(opacity=0); height:353px " />
<img src="http://aksmoney.com/images/mag/8.png" id="img_8" style="position:absolute; width:645px;opacity: 0; filter: alpha(opacity=0); height:353px " />
<img src="http://aksmoney.com/images/mag/9.png" id="img_9" style="position:absolute; width:645px;opacity: 0; filter: alpha(opacity=0); height:353px " />
<a href="http://alipromo.com/redirect/cpa/o/6c32355cccda19eca697d3f6b8c40947" id="go" title="Moda" ><img src="http://aksmoney.com/images/mag/1.png" id="img_1" style="position:absolute;opacity: 0; filter: alpha(opacity=0); " /></a>
<a href="http://alipromo.com/redirect/cpa/o/7415b125ad36017d4f0c0f5181bc8b52" id="go" title="Krasota" ><img src="http://aksmoney.com/images/mag/2.png" id="img_2" style="position:absolute;opacity: 0; filter: alpha(opacity=0); " /></a>
<a href="http://alipromo.com/redirect/cpa/o/4b82fc862f2878bb0d1c87749c1ce637" id="go" title="Smartfon" ><img src="http://aksmoney.com/images/mag/3.png" id="img_3" style="position:absolute;opacity: 0; filter: alpha(opacity=0); " /></a>
<a href="http://ru.itao.com/c/amelieitao?tracelog=itao_aenew" target="_blank" id="go" title="Konkurs" ><img src="http://aksmoney.com/images/mag/4.png" id="img_4" style="position:absolute;opacity: 0; filter: alpha(opacity=0); " /></a>
<a href="http://alipromo.com/redirect/cpa/o/0b15c84c040858461d5b9d57170f7be5" id="go" title="Amelie" ><img src="http://aksmoney.com/images/mag/5.png" id="img_5" style="position:absolute;opacity: 0; filter: alpha(opacity=0); " /></a>
<a href="http://alipromo.com/redirect/cpa/o/0731978897c1fcbaeb5be43699cb6d52" id="go" title="Podarki" ><img src="http://aksmoney.com/images/mag/6.png" id="img_6" style="position:absolute;opacity: 0; filter: alpha(opacity=0); " /></a>
<a href="http://alipromo.com/redirect/cpa/o/b6c342a76c803bb18ced534ffa90ec61" id="go" title="Electrnika" ><img src="http://aksmoney.com/images/mag/7.png" id="img_7" style="position:absolute;opacity: 0; filter: alpha(opacity=0); " /></a>
<a href="http://alipromo.com/redirect/cpa/o/d606c61078751f6c75f314ed28da65a0" id="go" title="Sport" ><img src="http://aksmoney.com/images/mag/8.png" id="img_8" style="position:absolute;opacity: 0; filter: alpha(opacity=0); " /></a>
<a href="http://alipromo.com/redirect/cpa/o/37922acb8e8688a83b2e6ac8e1993ff0" id="go" title="Expert" ><img src="http://aksmoney.com/images/mag/9.png" id="img_9" style="position:absolute;opacity: 0; filter: alpha(opacity=0); " /></a>
</div>
<script type="text/javascript">
var image_count = 9;
var interval = 1000; //пауза
var time_out = 15; //скорость смены картинки
var i = 5;
var timeout;
var opacity = 100;
function change_image() {
opacity--;
var j = i + 1;
var current_image = 'img_' + i;
if (i == image_count) j = 1;
var next_image = 'img_' + j;
document.getElementById(current_image).style.opaci ty=opacity/100;
document.getElementById(current_image).style.filte r='alpha(opacity='+opacity+')';
document.getElementById(next_image).style.opacity= (100-opacity)/100;
document.getElementById(next_image).style.filter=' alpha(opacity='+(100-opacity)+')';
timeout = setTimeout("change_image()", time_out);
if (opacity==1) {
opacity = 100;
clearTimeout(timeout);

i++;
if (i>image_count) i=1;
document.getElementById('go').href = ["http://alipromo.com/redirect/cpa/o/6c32355cccda19eca697d3f6b8c40947","http://alipromo.com/redirect/cpa/o/7415b125ad36017d4f0c0f5181bc8b52","http://alipromo.com/redirect/cpa/o/4b82fc862f2878bb0d1c87749c1ce637","http://ru.itao.com/c/amelieitao?tracelog=itao_aenew" target="_blank","http://alipromo.com/redirect/cpa/o/0b15c84c040858461d5b9d57170f7be5","http://alipromo.com/redirect/cpa/o/0731978897c1fcbaeb5be43699cb6d52","http://alipromo.com/redirect/cpa/o/b6c342a76c803bb18ced534ffa90ec61","http://alipromo.com/redirect/cpa/o/d606c61078751f6c75f314ed28da65a0","http://alipromo.com/redirect/cpa/o/37922acb8e8688a83b2e6ac8e1993ff0"][i-1]
document.getElementById('go').title = ["Moda","Krasota","Smartfon","Konkurs","Amelie","Po darki","Electrnika","Sport","Expert"][i-1]
timeout = setTimeout("change_image()", interval);
}
}
change_image()
</script>

</body>

</html>
Ответить с цитированием