jQuer焦点图--带缩略图的焦点图幻灯代码

 

 

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="1网" />
<meta name="description" content="1网" />
<title>1网</title>
<meta name="author" content="1" />
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<!--
<link href="css/index.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/lrtk.js"></script>
-->

<style type="text/css">
   .indexCon{width:782px;overflow:hidden;}
.indexCon .flashBanner{width:782px;height:326px;overflow:hidden;margin-bottom:12px;}
.flashBanner{position:relative;}
.flashBanner .mask{height:32px;line-height:32px;background-color:#000;width:100%;text-align:right;
 position:absolute;left:0;bottom:-32px;filter:alpha(opacity=70);-moz-opacity:0.7;opacity:0.7;overflow:hidden;}
.flashBanner .mask img{vertical-align:middle;margin-right:10px;cursor:pointer;}
.flashBanner .mask img.show{border:1px solid #fff;}
img{border:0 none;}
</style>
<script type="text/javascript">
   $(function(){
 $(".flashBanner").each(function(){
  var timer;
  $(".flashBanner .mask img").mouseover(function(){
   var index = $(".flashBanner .mask img").index($(this)); 
   changeImg(index);
  }).eq(0).mouseover();
  $(this).find(".mask").animate({
   "bottom":"0" 
  },700);
   
  $(".flashBanner").hover(function(){
   clearInterval(timer); 
  },function(){
   timer = setInterval(function(){
    var show = $(".flashBanner .mask img.show").index();
    if (show >= $(".flashBanner .mask img").length-1)
     show = 0;
    else
     show ++;
    changeImg(show);
   },3000);
  });
  
  
  function changeImg (index)
  {
   $(".flashBanner .mask img").removeClass("show").eq(index).addClass("show");
   $(".flashBanner .bigImg").parents("a").attr("href",$(".flashBanner .mask img").eq(index).attr("link"));
   $(".flashBanner .bigImg").hide().attr("src",$(".flashBanner .mask img").eq(index).attr("uri")).fadeIn("slow");
  }
  timer = setInterval(function(){
   var show = $(".flashBanner .mask img.show").index();
   if (show >= $(".flashBanner .mask img").length-1)
    show = 0;
   else
    show ++;
   changeImg(show);
  },3000);
 });
});
</script>
</head>
<body>
<!-- indexCon start -->
<div class="indexCon fl">
    <div class="flashBanner">
        <a href="#"><img class="bigImg" width="782" height="326" /></a>
        <div class="mask">
       
        <img src="images/201109291718425.jpg" uri="images/201109291718425.jpg" link="http://www.baidu.com/"  width="60" height="22"/>
       
        <img src="images/201207261743282.jpg" uri="images/201207261743282.jpg" link="http://www.baidu.com/"  width="60" height="22"/>
       
        <img src="images/201109291718573.jpg" uri="images/201109291718573.jpg" link="http://www.baidu.com/"  width="60" height="22"/>
       
        <img src="images/201109291719040.jpg" uri="images/201109291719040.jpg" link="http://www.baidu.com/"  width="60" height="22"/>
       
        <img src="images/201207311057406.jpg" uri="images/201207311057406.jpg" link="http://www.baidu.com/"  width="60" height="22"/>
       
        </div>
    </div>
</div>
<!-- indexCon end -->

 

</body>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值