Html幻灯片效果的广告

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>很不错的广告图片幻灯切换效果丨芯晴网页特效丨CsrCode.Cn</title>

<meta http-equiv="content-type" content="text/html;charset=gb2312">

<!--把下面代码加到<head>与</head>之间-->

<style type="text/css">

.picshow{z-index:444;position:relative;background-color:#e4f2fa;width:100%;height:240px}

.picshow_main{position:relative;width:320px;height:240px}

.picshow_main .imgbig{filter:progid:dximagetransform.microsoft.wipe

(gradientsize=1.0,wipestyle=4,motion=forward);width:320px;height:240px}

.picshow_change{position:absolute;text-align:left;bottom:0px;height:30px;right:0px;left:160px}

.picshow_change img{width:15px;height:15px}

.picshow_change a{border:1px solid;display:block;float:left;margin-right:5px;-display:inline}

a.axx{border-color:#555}

a.axx:hover{border-color:#000}

a.axx img{filter:alpha(opacity=40);opacity:0.4;-moz-opacity:0.4}

a.axx:hover img{filter:alpha(opacity=100);opacity:1.0;-moz-opacity:1.0}

a.bxx{border-color:#000}

a.bxx:hover{border-color:#000}

img{border:0px}

</style>

</head>

<body>

<!--把下面代码加到<body>与</body>之间-->

<script language="javascript">

 //图片滚动展示Start

 var counts = 3;

 img1 = new Image();

 img1.src = 'http://www.csrcode.cn/images/m02.jpg';

 img2 = new Image();

 img2.src = 'http://www.csrcode.cn/images/m09.jpg';

 img3 = new Image();

 img3.src = 'http://www.csrcode.cn/images/m10.jpg';

 var smallImg = new Array();

 //小图

 smallImg[0] = 'http://www.CsrCode.cn/html/txdm_2/images/20100829/index_adb1.gif';

 smallImg[1] = 'http://www.CsrCode.cn/html/txdm_2/images/20100829/index_adb2.gif';

 smallImg[2] = 'http://www.CsrCode.cn/html/txdm_2/images/20100829/index_adb3.gif';

 //链接地址

 url1 = new Image();

 url1.src = 'http://www.zzsky.cn';

 url2 = new Image();

 url2.src = 'http://www.zzsky.cn';

 url3 = new Image();

 url3.src = 'http://www.zzsky.cn';

 //alt值

 alt1 = new Image();

 alt1.alt = '野花绽放';

 alt2 = new Image();

 alt2.alt = '小雏菊';

 alt3 = new Image();

 alt3.alt = '往事如茶';

 var nn = 1;

 var key = 0;

 function change_img() {

  if (key == 0) {

   key = 1;

  } else if (document.all) {

   document.getElementById("pic").filters[0].Apply();

   document.getElementById("pic").filters[0].Play(duration = 2);

  }

  eval('document.getElementById("pic").src=img' + nn + '.src');

  eval('document.getElementById("url").href=url' + nn + '.src');

  eval('document.getElementById("pic").alt=alt' + nn + '.alt');

  if (nn == 1) {

   document.getElementById("url").target = "_blank";

   document.getElementById("url").style.cursor = "pointer";

  } else {

   document.getElementById("url").target = "_blank"

   document.getElementById("url").style.cursor = "pointer"

  }

  for ( var i = 1; i <= counts; i++) {

   document.getElementById("xxjdjj" + i).className = 'axx';

  }

  document.getElementById("xxjdjj" + nn).className = 'bxx';

  nn++;

  if (nn > counts) {

   nn = 1;

  }

  tt = setTimeout('change_img()', 7000);

 }

 function changeimg(n) {

  nn = n;

  window.clearInterval(tt);

  change_img();

 }

 function ImageShow() {

  document.write('<div class="picshow_main">');

  document.write('<div><a id="url"><img id="pic" class="imgbig" /></a></div>');

  document.write('<div class="picshow_change">');

  for ( var i = 0; i < counts; i++) {

   document.write('<a href="javascript:changeimg(' + (i + 1)

     + ');" id="xxjdjj' + (i + 1)

     + '" class="axx" target="_self"><img src="' + smallImg[i]

     + '"></a>');

  }

  document.write('</div></div>');

  change_img();

 }

 //图片滚动展示End

</script>

<script language="javascript" type="text/javascript">

 ImageShow();

</script>

</body>

</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值