jquery 圖片輪換

來源:互聯網
上載者:User

標籤:

jquery 圖片輪換

1.下載jquery.superslide.2.1.1.js (百度搜尋)

2.下載Jquery-1.4.1.js(百度搜尋下載)

準備工作好了,下面開始實現

3.html

<div class="lunzhuan">

  <ul class="pic">

    <li><a href="#"> <img src="../images/1.jpg"/></a> </li>

    <li><a href="#"> <img src="../images/2.jpg"/></a> </li>

    <li><a href="#"> <img src="../images/3.jpg"/></a> </li>

  </ul>

  <a class="Prev" href="javascript:void(0)"></a>

  <a class="next" href="javascript:void(0)"></a>

  <div class="num"> <ul></ul></div>

</div>

4.css樣式

<style type="text/css">

  body,div,ul,li

    {

      padding:0;

      marin:0;

    }

    ul{list-style:none}

    img{border:none}

    a{blr:express(this.onFouce=this.blur()); outline:none}

    .lunhuan

    {

      width:600px;

      height:260px;

      margin:0;

      postion:relative;

      overflow:hidden;

      margin-bottom:0;

    }

    .lunhuan .num

    {

      overflow:hidden;

      height:25px;

      position:absolute;

      bottom:12px;

      left:15px;

      zoom:1;

      z-index:3;

    }

    .lunhuan .num li

    {

      width:25px;

      height:25px;

      text-height:25px;

      text-aligen:center;

      font-weight:400;

      font-family:"微軟雅黑",Arial;

      color:#FFFFFF;

      background:#444444;

      margin-right:10px;      

      border-radius:50%;

      cursor:pointer;

      float:left;

    }

    .lunhuan .num li .on

    {

      background:#FF7700;

    }

    .lunhuan .prev,.lunhuan .next

    {

      display:none;

      width:40px;

      height:100px;

      background:url(/images/leftRight.png)  --<>這個樣式的圖片

      position:absolute;

      top:80px;

    }    

    .lunhuan .prev

    {

      left:0;

    }

    .lunhuan .next

    {

      right:0;

      background-position:right;

    }

</style>

5.引用兩個jq檔案 開始寫jq

<script type="text/javascript">

$(function(){

  $(".lunhuan").hover(fonction(){

    $(this).find(".prev,.next").fadeTo("show",0.1);

  },function(){

  $(this).find(".prev,.next").hide();  

})

$(".prev,.next").hover(){

  $(this).fadeTo("show",0.5);

},function(){

  $(this).fadeTo("show",0.1);

})

$(".lunhuan").slide({titCell:".num ul", mainCell:".pic",effect:"fold",autoPlay:true,delayTime:200,autoPage:true});

});

</script>

結束。

jquery 圖片輪換

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.