亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

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

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

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

同仁县| 丰县| 隆尧县| 威远县| 马公市| 昌江| 龙南县| 姜堰市| 北票市| 黔西县| 烟台市| 罗源县| 神农架林区| 海南省| 沙湾县| 喜德县| 镇江市| 江都市| 会昌县| 郓城县| 宾阳县| 韩城市| 遵义市| 区。| 榆林市| 会泽县| 旅游| 收藏| 策勒县| 和田县| 宝丰县| 德庆县| 金华市| 永年县| 蓝田县| 株洲县| 彩票| 合山市| 林西县| 彰武县| 特克斯县|