栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

滚动图片案例

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

滚动图片案例




    
    滑动图片案例
    
    .content {
        width: 100%;
        height: 3000px;
    }
    .topBox {
        width: 100%;
        height: 800px;
        background-color: #ccc;
    }
    .imgBox {
        position: relative;
        width: 100%;
    }
    .imgBox .wrapper {
        position: relative;
        display: flex;
        flex-direction: row;
        width: 100%;
    }
    .imgBox .wrapper .leftText {
        flex: 1;
    }
    .imgBox .wrapper .rightImg {
        position: relative;flex: 1;
    }
    .photo {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        opacity: 1;
        transition: opacity 1s ease;
        background-color: aqua;
    }
    .photo_1 {
        opacity: 0;
        z-index: 1;
    }
    .photo_2 {
        opacity: 0;
        z-index: 2;
    }
    .photo_3 {
        opacity: 0;
        z-index: 3;
    }
    .photo_4 {
        opacity: 0;
        z-index: 4;
    }
    .photo_5 {
        opacity: 0;
        z-index: 5;
    }
    .bottomBox {
        width: 100%;
        height: 200px;
        background-color: #f3deac;
    }
    


    
        
        
            
                
                    

测试

                                                                                                                                                                                                    

实现效果:滑动到图片包裹层的时候,图片层固定定位,继续下滑,图片切换,上滑的时候恢复

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/245199.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号