弘帝企业智能建站系统交流平台

 找回密码
 立即注册
查看: 782|回复: 9

BootStrap轮播特效展示

[复制链接]
发表于 2022-2-26 20:24:20 | 显示全部楼层 |阅读模式
全面解析Bootstrap中Carousel轮播的使用方法
https://www.uoften.com/program/js/20180411/21875.html
轮播在线编辑器:
https://wow.techbrood.com/fiddle/11853

特效:http://demo.datouwang.com/uploads/demo/jiaoben/2020/jiaoben1565/
HTML:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>bootstrap制作图片轮播切换特效演示</title>

<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/datouwang.com.css">


</head>
<body>

<div class="section dwo full-height over-hide px-4 px-sm-0">
        <div class="container">
                <div class="row full-height justify-content-center">
                        <div class="col-lg-10 col-xl-8 align-self-center padding-tb">
                                <div class="section mx-auto text-center slider-height-padding">
                                        <input class="checkbox frst" type="radio" id="slider-1" name="slider" checked>
                                        <label for="slider-1"></label>
                                        <input class="checkbox scnd" type="radio" name="slider" id="slider-2">
                                        <label for="slider-2"></label>
                                        <input class="checkbox thrd" type="radio" name="slider" id="slider-3">
                                        <label for="slider-3"></label>
                                        <input class="checkbox foth" type="radio" name="slider" id="slider-4">
                                        <label for="slider-4"></label>
                                        <ul>
                                                <li></li>
                                                <li></li>
                                                <li></li>
                                                <li></li>
                                        </ul>
                                </div>
                        </div>
                </div>
        </div>
</div>

</body>
</html>


CSS:
/* DaTouWang URL: www.datouwang.com */
body {
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.7;
    color: #343434;
    background-color: #f1f2f6;
    overflow-x: hidden;
}
a {
    cursor: pointer;
}
a:hover {
    text-decoration: none;
}

.section {
    position: relative;
    width: 100%;
    display: block;
}
.full-height {
    min-height: 100vh;
}
.over-hide {
    overflow: hidden;
}
.padding-tb {
    padding: 100px 0;
}
[type="radio"]:checked,
[type="radio"]:not(:checked) {
    position: absolute;
    left: -9999px;
}
.checkbox:checked + label,
.checkbox:not(:checked) + label {
    position: relative;
    cursor: pointer;
    margin: 0 auto;
    text-align: center;
    margin-right: 6px;
    margin-left: 6px;
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #bdc3c7;
    background-size: cover;
    background-position: center;
    box-sizing: border-box;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    background-image: url("../images/sl1.jpg");
    animation: border-transform 6s linear infinite alternate forwards;
    -webkit-animation-play-state: paused;
    -moz-animation-play-state: paused;
    animation-play-state: paused;
}
.checkbox.scnd + label {
    background-image: url("../images/sl2.jpg");
}
.checkbox.thrd + label {
    background-image: url("../images/sl3.jpg");
}
.checkbox.foth + label {
    background-image: url("../images/sl4.jpg");
}

.checkbox:checked + label {
    box-shadow: 0 8px 25px 0 rgba(16, 39, 112, 0.3);
    transform: scale(1.3);
    -webkit-animation-play-state: running;
    -moz-animation-play-state: running;
    animation-play-state: running;
}
@keyframes border-transform {
    0%,
    100% {
        border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    }
    14% {
        border-radius: 40% 60% 54% 46% / 49% 60% 40% 51%;
    }
    28% {
        border-radius: 54% 46% 38% 62% / 49% 70% 30% 51%;
    }
    42% {
        border-radius: 61% 39% 55% 45% / 61% 38% 62% 39%;
    }
    56% {
        border-radius: 61% 39% 67% 33% / 70% 50% 50% 30%;
    }
    70% {
        border-radius: 50% 50% 34% 66% / 56% 68% 32% 44%;
    }
    84% {
        border-radius: 46% 54% 50% 50% / 35% 61% 39% 65%;
    }
}
.slider-height-padding {
    padding-top: 440px;
}
ul {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    z-index: 100;
    padding: 0;
    margin: 0;
    list-style: none;
}
ul li {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: block;
    z-index: 100;
    padding: 0;
    margin: 0;
    list-style: none;
    height: 400px;
    border: 5px solid #bdc3c7;
    background-size: cover;
    background-position: center;
    background-image: url("../images/sl1.jpg");
    border-radius: 50%;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
    font-weight: 900;
    font-size: 16px;
    letter-spacing: 2px;
    line-height: 2.7;
    color: #343434;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 25px 0 rgba(16, 39, 112, 0.1);
    -webkit-transition: all 0.5s ease;
    transition: all 0.5s ease;
}
ul li span {
    mix-blend-mode: difference;
}
ul li:nth-child(2) {
    background-image: url("../images/sl2.jpg");
}
ul li:nth-child(3) {
    background-image: url("../images/sl3.jpg");
}
ul li:nth-child(4) {
    background-image: url("../images/sl4.jpg");
}
.checkbox.frst:checked ~ ul li:nth-child(1) {
    opacity: 1;
    pointer-events: auto;
    border-radius: 16px;
}
.checkbox.scnd:checked ~ ul li:nth-child(2) {
    opacity: 1;
    pointer-events: auto;
    border-radius: 16px;
}
.checkbox.thrd:checked ~ ul li:nth-child(3) {
    opacity: 1;
    pointer-events: auto;
    border-radius: 16px;
}
.checkbox.foth:checked ~ ul li:nth-child(4) {
    opacity: 1;
    pointer-events: auto;
    border-radius: 16px;
}
@media (max-width: 767px) {
    .slider-height-padding {
        padding-top: 340px;
    }
    ul li {
        height: 300px;
        font-size: 13px;
        letter-spacing: 1px;
    }
}
@media (max-width: 575px) {
    .slider-height-padding {
        padding-top: 240px;
    }
    ul li {
        height: 200px;
    }
}


回复

使用道具 举报

 楼主| 发表于 2022-2-26 20:28:34 | 显示全部楼层
响应Bootstrap轮播图插件slider兼容触摸屏
http://www.bootstrapmb.com/item/1021/preview
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-26 20:30:51 | 显示全部楼层
BootStrap 4.3.1 Carousel增加淡入淡出效果
https://www.hanost.com/1605.html

更新您的 JS 和CSS文件,上面提供下载链接;
添加Class属性.carousel-fade ,即可实现淡入淡出效果,data-interval="10000"是每张轮播图持续时间,单位为ms(毫秒)。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-26 20:35:37 | 显示全部楼层
BootStrap 4 轮播图实现缩放效果
https://www.hanost.com/1557.html

在class中添加carousel-scale即可
<div id="carouselExampleSlidesOnly" class="carousel slide carousel-scale" data-ride="carousel">
  <div class="carousel-inner">
    <div class="carousel-item active">
        <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
  </div>
</div>

.carousel-scale .carousel-item img{
  -webkit-transform: scale(1.12);
   transform: scale(1.12);
}
.carousel-scale .carousel-item.active img {
  -webkit-animation: scaleUpDown 6s forwards cubic-bezier(0.250, 0.460, 0.450, 0.940);
  animation: scaleUpDown 6s forwards cubic-bezier(0.250, 0.460, 0.450, 0.940);
}
@-webkit-keyframes scaleUpDown {
  from {
   -webkit-transform: scale(1.12);
   transform: scale(1.12);
  }
  to {
   -webkit-transform: scale(1);
   transform: scale(1);
  }
}
@keyframes scaleUpDown {
  from {
   -webkit-transform: scale(1.12);
   transform: scale(1.12);
  }
  to {
   -webkit-transform: scale(1);
   transform: scale(1);
  }
}
此样式中使用了CSS 3 动画属性中的scale ,实现缩放效果,您可以通过改变scale(1.12)的值实现您需要的缩放效果;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-26 20:37:26 | 显示全部楼层
漂亮的bootstrap轮播图悬浮选中效果
http://www.jqueryfuns.com/resource/view/1614
8b1c0b17313e5bf8ffe55286bf78f9b313416.png
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-26 20:39:44 | 显示全部楼层
修改 Bootstrap 幻灯片的轮播效果切换为淡入淡出方式
https://www.wenjiangs.com/articl ... arousel-switch.html

Bootstrap 的轮播(Carousel)插件制作出的幻灯片,默认的图片切换是左右滑动式的,效果虽然好看也能接受,但是项目需求需要使用淡入淡出的方式切换。

修改 Bootstrap 幻灯片的轮播效果切换方式

使用 Bootstrap 的轮播(Carousel)插件制作幻灯片,html 代码如下:

<div id="myCarousel" class="carousel slide">
   <!-- 轮播(Carousel)指标 -->
   <ol class="carousel-indicators">
      <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
      <li data-target="#myCarousel" data-slide-to="1"></li>
   </ol>   
   <!-- 轮播(Carousel)项目 -->
   <div class="carousel-inner">
      <div class="item active">
         <img src="http://www.wpmomo.com/wp-content/uploads/2015/04/slider13.png" alt="First slide">
      </div>
      <div class="item">
         <img src="http://www.wpmomo.com/wp-content/uploads/2015/04/slider2.png" alt="Second slide">
      </div>
   </div>
   <!-- 轮播(Carousel)导航 -->
   <a class="carousel-control left" href="#myCarousel" data-slide="prev">&#8249;</a>
   <a class="carousel-control right" href="#myCarousel" data-slide="next">&#8250;</a>
</div>
如此制作出的幻灯片,默认的图片切换是左右滑动式的,如何修改它的切换效果呢?将上述代码的:

<div id="myCarousel" class="carousel slide">
修改一下,加入一个 carousel-fade 类:

<div id="myCarousel" class="carousel-fade carousel slide">
然后添加 carousel-fade 的 css 样式:

.carousel-fade .carousel-inner .item{  
    opacity:0;  
    -webkit-transition-property:opacity ;  
    -moz-transition-property:opacity ;  
    -ms-transition-property:opacity ;  
    -o-transition-property:opacity ;  
    transition-property:opacity ;
}
.carousel-fade .carousel-inner .active{  
    opacity: 1;
}
.carousel-fade .carousel-inner .active.left,.carousel-fade .carousel-inner .active.right{  
    left: 0;  
    opacity: 0;
}
.carousel-fade .carousel-inner .next.left,.carousel-fade .carousel-inner .prev.right {
    opacity: 1;
}
这样,幻灯片的切换效果变成淡入淡出式了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-26 20:42:33 | 显示全部楼层
Bootstrap网页文字上下轮播滚动特效jQuery插件代码
http://www.100sucai.com/demos.php?id=1561040944

6081.jpg
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-26 20:51:32 | 显示全部楼层
bootstrap轮播组件,大屏幕图片居中效果
https://www.cnblogs.com/lijinwen/p/6055763.html
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-26 20:59:41 | 显示全部楼层
bootslider响应bootstrapcss3触屏滑块轮播图
https://www.jq22.com/yanshi9014

多样动画片断,值得推荐。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-26 21:15:17 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|弘帝企业智能建站系统 ( 皖ICP备07503252号 )

GMT+8, 2024-4-29 23:44 , Processed in 0.132285 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表