国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jQuery實現花式輪播之圣誕節禮物傳送效果

2019-11-19 18:16:54
字體:
來源:轉載
供稿:網友

旋轉出發,旋轉到達。鼠標經過停止,點擊拆禮物!

          寫的比較簡單,喜歡點贊收藏哦。

          請在谷歌等高版本瀏覽器打開^-^

<!DOCTYPE html><html lang="en"><head>  <meta charset="UTF-8">  <title>圣誕禮物傳送輪播</title>  <style>    html, body {                height: 100%;                margin: 0;                padding: 0;            }    .cr{      width: 100%;      position: relative;      background: url("http://cdn.attach.qdfuns.com/notes/pics/201612/15/174106gbm3famm0piq62mm.png") no-repeat 0 0;      -webkit-background-size: 100% 100%;      background-size: 100% 100%;      overflow: hidden;    }    .cr-l,.cr-r{      position: absolute;      bottom:10%;      width: 20.8%;      height: 70%;      z-index:100;    }    .cr-l img,.cr-r img{      width: 100%;      position: absolute;      top:50%;    }    .cr-l{      left: 0;    }    .cr-r{      right:0;    }    .cr-icon{      bottom: 15%;      left:0;      position: absolute;      z-index: 1000;      width: 100%;      height: 70%;      text-align: center;    }    .cr-icon img{      margin-right: 25px;      width: 10%;      vertical-align: top;      position: absolute;      bottom: 0;      opacity: 1;      transform:rotate(0deg);      transition: all 1s;    }    .cr-icon img:first-child{      transform:rotate(-90deg);      -webkit-transform:rotate(-90deg);      opacity: 0;      width: 0;    }    .cr-icon img:last-child{      transform:rotate(90deg);      -webkit-transform:rotate(90deg);      opacity: 0;      width: 0;    }  </style></head><body>  <div class="cr">    <div class="cr-l"><img src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103o5zx1pzh4x1ccpcb.png" alt=""/></div>    <div class="cr-icon">      <div id="cr-icon">        <img style="left:5%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/>        <img style="left:25%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/>        <img style="left:45%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/>        <img style="left:65%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/>        <img style="left:85%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/>      </div>    </div>    <div class="cr-r"><img src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103dz0uhvec7nbunqwc.png" alt=""/></div>  </div>  <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>  <script>    $(".cr-icon img").click(function(){      if($(this).attr("src") == "http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png"){        $(this).attr("src","http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103ciomobruzrkbhhs5.png");      }else{        $(this).attr("src","http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png");      }    });    $(function() {      var end = document.body.clientWidth;      var height = document.body.scrollHeight;      $(".cr").css("height",height);      function scrollLogo() {        $("#cr-icon img").each(function () {          var left = parseInt($(this).css("left"));          left += end * 0.2;          $(this).css("left", left + "px");        });        $("#cr-icon img:last").insertBefore($("#cr-icon img:first")).css("left", document.body.clientWidth * 0.05).fadeIn();      }      setTimeout(scrollLogo,0);      var scroll = setInterval(scrollLogo, 1500);      $("#cr-icon img").mouseenter(function () {        clearInterval(scroll);      });      $("#cr-icon img").mouseleave(function () {        scroll = setInterval(scrollLogo, 1500);      });    });  </script></body></html>

效果圖如下所示:

以上所述是小編給大家介紹的jQuery實現花式輪播之圣誕節禮物傳送效果,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對武林網網站的支持!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 萨嘎县| 泸水县| 陇西县| 临西县| 郯城县| 富蕴县| 屏东市| 和林格尔县| 夏邑县| 广河县| 来凤县| 雷山县| 和龙市| 华宁县| SHOW| 珲春市| 乌兰县| 长武县| 荥经县| 阳朔县| 汝阳县| 宁陵县| 靖西县| 阿合奇县| 绥德县| 关岭| 唐山市| 津市市| 盐边县| 邮箱| 方山县| 东海县| 昆山市| 吉林市| 曲阳县| 周口市| 三门峡市| 玉屏| 出国| 大姚县| 普格县|