91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

CSS3如何制作輪播圖切割效果

發布時間:2022-02-28 10:30:23 來源:億速云 閱讀:119 作者:小新 欄目:web開發

這篇文章主要介紹CSS3如何制作輪播圖切割效果,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!

<!DOCTYPE html>

<html lang="en">

<head>

         <meta charset="UTF-8">

         <title>炫酷CSS3切割效果輪播圖</title>

         <meta name="description" content="炫酷CSS3切割效果輪播圖" />

         <meta name="keywords" content="炫酷,CSS3,切割效果,輪播圖" />

         <meta name="author" content="js代碼" />

         <meta name="Copyright" content="js代碼" />

         <style type="text/css">

                   html,body,div{

                            margin: 0;

                            padding: 0;                         

                   }

                   body{background-color: #232323}

                   .slider-outer{

                            width: 560px;

                            height: 300px;

                            margin: 150px auto;

                            background-color: #f60;

                            position: relative;

                   }

                   .img-item{

                            position: absolute;

                            width: 112px;

                            height: 100%;

                            background-color: #f10;

                            transition: all 1.5s;

                            /*設置子元素在3D空間中呈現*/

                            transform-style: preserve-3d;

                   }

                   /*讓圖片可以構成一個有四個面的長方體 start*/

                   .img{

                            width: 100%;

                            height: 100%;

                            position: absolute;

                            background-size: cover;

                   }

                   .img:nth-child(1){

                            background: url(images/1.png) no-repeat;

                            transform: rotateX(0deg) translateZ(150px);

                   }

                   .img:nth-child(2){

                            background: url(images/2.png) no-repeat;

                            transform: rotateX(-90deg) translateZ(150px);

                   }

                   .img:nth-child(3){

                            background: url(images/3.png) no-repeat;

                            transform: rotateX(-180deg) translateZ(150px);

                   }

                   .img:nth-child(4){

                            background: url(images/4.png) no-repeat;

                            transform: rotateX(-270deg) translateZ(150px);

                   }

                   /*讓圖片可以構成一個有四個面的長方體 end*/

                   .btns{

                            position: absolute;

                            top: 50%;

                            width: 100%;

                            height: 70px;

                            margin-top: -35px;

                   }

                   .prev,

                   .next{

                            width: 70px;

                            height: 70px;

                            line-height: 70px;

                            text-align: center;

                            background-color: rgba(0,0,0,.3);

                            color: #fff;

                            font-size: 30px;

                            cursor: pointer;

                            position: absolute;

                   }

                   .prev{

                            left: 0;

                   }

                   .next{

                            right: 0;

                   }

         </style>

         <script src="js/jquery-1.11.3.min.js"></script>

         <script type="text/javascript">

                   $(function (){

                            var num = 0;

                            $("#j_silder_outer .img-item").each(function(index, el) {

                                     $(this).css({

                                               "left":$(this).width() * index + "px",

                                               /*讓每個img-item延時一定時間執行動畫*/

                                               "transitionDelay": index * 0.3 + "s"

                                     });

                                     $(this).find(".img").css({

                                               "backgroundPosition": -$(this).width() * index + "px"

                                     });;

                            });

 

                            $(".prev").on("click",function (){

                                     $("#j_silder_outer .img-item").css("transform", "rotateX(" + (++num * 90) + "deg)");

                            });

 

                            $(".next").on("click",function (){

                                     $("#j_silder_outer .img-item").css("transform", "rotateX(" + (--num * 90) + "deg)");

                            });

                           

                            var timejg=4000;//輪播間隔時間

                            var time = setInterval(move,timejg);

                            function move(){

                                     $("#j_silder_outer .img-item").css("transform", "rotateX(" + (--num * 90) + "deg)");

                            }

                            $('.slider-outer').hover(function(){

                                     clearInterval(time);

                            },function(){

                                     time = setInterval(move,timejg);

                            });

 

 

                   })

                  

                  

 

                  

         </script>

</head>

<body>

         <div class="slider-outer" id="j_silder_outer">

                   <div class="img-item">

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                   </div>

                   <div class="img-item">

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                   </div>

                   <div class="img-item">

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                   </div>

                   <div class="img-item">

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                   </div>

                   <div class="img-item">

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                            <div class="img"></div>

                   </div>

                   <div class="btns" data-num="0">

                            <div class="prev"><</div>

                            <div class="next">></div>

                   </div>

         </div>

</body>

</html>

以上是“CSS3如何制作輪播圖切割效果”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注億速云行業資訊頻道!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

延吉市| 秭归县| 广东省| 南阳市| 泸州市| 宝鸡市| 象山县| 壶关县| 安阳县| 叶城县| 监利县| 奉贤区| 祁门县| 岑巩县| 织金县| 万全县| 乐安县| 河源市| 河池市| 湘阴县| 深圳市| 湘西| 江陵县| 五莲县| 峨眉山市| 鸡东县| 二连浩特市| 沅陵县| 兴文县| 清镇市| 深泽县| 永善县| 镇坪县| 泗水县| 夏河县| 上杭县| 临漳县| 张家港市| 喀喇| 建瓯市| 临湘市|