css实现鼠标滚轮控制div横向滚动条左右移动

代码语言:html

所属分类:加载滚动

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

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title> Horizontal scroll (extensive example)</title>
    <style>
        ::-webkit-scrollbar {
            width: 2px;
            height: 2px;
        }
        ::-webkit-scrollbar-button {
            width: 2px;
            height: 2px;
        }

        div {
            box-sizing: border-box;
        }

        body {
            background: #111;
        }

        .horizontal-scroll-wrapper {
            position: absolute;
            display: block;
            top: 0;
            left: 0;
            width: 80px;
            max-height: 500px;
            margin: 0;
            background: #abc;
            overflow-y: auto;
            overflow-x: hidden;
            transform: rotate(-90deg) translateY(-80px);
            transform-origin: right top;
        }
        .horizontal-scroll-wrapper > div {
            display: block;
            padding: 5px;
            background: #cab;
            transform: rotate(90deg);
            transform-origin: right top;
        }

        .squares {
            padding: 60px 0 0 0;
        }

        .squares > div {
            width: 60px;
            height: 60px;
            margin: 10px;
        }

        .rectangles {
            top: 100px;
            padding: 100px 0 0 0;
        }
        .rectangles > div {
            width: 1.........完整代码请登录后点击上方下载按钮下载查看

网友评论0