横向图片分页滚动效果代码

代码语言:html

所属分类:加载滚动

代码描述:横向图片分页滚动效果代码

代码标签: 滚动 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="UTF-8">





    <style>
        html {
            box-sizing: border-box;
            background-color: #ffecb3;
        }

        *,
        *:before,
        *:after {
            box-sizing: inherit;
        }

        ul {
            list-style-type: none;
            display: flex;
            margin: 0;
            width: 100%;
            height: 100%;
            overflow-x: scroll;
            /* prevent accidentally going back or triggering other swipe events */
            overscroll-behavior: contain;
            /* hide scroll bar */
            scrollbar-width: none;
            -ms-overflow-style: none;
            /* momentum scroll on iOS */
            -webkit-overflow-scrolling: touch;
            /* disbable vertical scroll for touch */
            touch-action: pan-x;
            /* scroll snapping */
            scroll-snap-type: x mandatory;
        }
        ul::-webkit-scrollbar {
            display: none;
        }
        ul li {
            background-color: #ffffff;
            box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
            margin: 15px 15px 15px 0;
            text-align: center;
            font-family: arial;
            padding: 20px 20px 40px 20px;
            width: 80vw;
            height: 60vh;
            display: flex;
            flex-direction: column;
            /* scroll snapping */
            scroll-snap-align: center;
            /* hacky fix for padding at the end of the list */
        }
        ul li:last-child {
            position: relative;
        }
        ul li:last-child::after {
            position: absolute;
            left: 100%;
            height: 1px;
            width: 20px;
            display: block;
            content: "";
        }
        ul li img {
            padding-bottom: 20.........完整代码请登录后点击上方下载按钮下载查看

网友评论0