jquery实现滑动选择数量效果代码

代码语言:html

所属分类:选择器

代码描述:jquery实现滑动选择数量效果代码

代码标签: 选择 数量 效果

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

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
    <style>
        body {
            padding-top: 100px;
        }
        ul,li {
            padding: 0;
            margin: 0;
            list-style-type: none;
        }
        .clearfix:after {
            display: block;
            content: "";
            clear: both;
        }

        .slider-date {
            height: 36px;
            line-height: 36px;
            background: #e8e8e8;
            display: inline-block;
            position: relative;
        }
        .slider-date .slider-bg li {
            position: relative;
            float: left;
            width: 50px;
            border-left: solid 1px #ddd;
            font-size: 12px;
            text-align: center;
        }
        .slider-date .slider-bg span {
            display: none;
        }

        .slider-date .slider-bg li:first-child {
            border-left: none;
        }
        .slider-date .slider-bar {
            position: absolute;
            top: -2px;
            left: 0;
            overflow: hidden;
            height: 40px;
            width: 50px;
        }
        .slider-date .slider-bar ul {
            margin-top: 1px;
            background: #43bfe3;
            color: #fff;
            height: 36px;
            width: 1000px;
        }
        .slider-date .slider-bar-btn {
            line-height: 40px;
            text-align: center;
            position: absolute;
            top: -2px;
            right: 0px;
            display: block;
            width: 16px;
            height: 40px;
            background: #2dacd1;
            color: #fff;
        }
        .slider-date .slider-bar-btn i {
            display: inline-block;
            margin: 12px 2px;
            width: 2px;
            height: 12px;
            background: #68c3de;
        }
    </style>
</head>

<body>
    <center>
        <div class="slider-date" id="slider-date-1">

            <!--底层-->
            <ul class="slider-bg clearfix">
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
                <li>5</li>
                <li>6</li>
                <li>7</li>
                <li>8</li>
                <li>9</li>
                <li>1年</li>
                <li>2年</li>
                <li>3年</li>
            </ul>

            <!--互动层-->
            <div class="slider-bar">
                <ul class="slider-bg clearfix">
                    <li>1<span>1个月</span></li>
                    <li>2<span>2个月</span></li>
                    <li>3<span>3个月</span></li>
                    <li>4<span>4个月</span></li>
                    <li>5<span>5个月</span></li>
                    <li>6<span>6个月</span></li>
                    <li>7<span>7个月</span></li>
                    <li>8<span>8个月</span></li>
                    <li>9<span>9个月</span></li>
                    <li>1年<span>1年</span></li>
                    <li>2年<span>2年</span></li>
                    <li>3年<span>3年</span></li>
                </ul>
                <!--滑块按钮-->
                <a href="javascript:;" class="slider-bar-btn"><i></i><i></i></a>
            </div>

        </div>

        <br>
        <br>

        <div class="slider-date" id="slider-date-2">

            <!--底层-->
            <ul class="slider-bg clearfix">
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
                <li>5</li>
                <li>6</li>
                <li>7</li>
                <li>8</li>
                <li>9</li>
                <li>1年</li>
                <li>2年</li>
                <li>3年</li>
            </ul>

            <!--互动层-->
            <div class="slider-bar">
                <ul class="slider-bg clearfix">
                    <li>1<span>1个月</span></li>
                    <li>2<span>2个月</span></li>
                    <li>3<span>3个月</span></li>
                    <li>4<span>4个月</span></li>
                    <li>5<span>5个月</span></li>
                    <li>6<span>6个月</span></li>
                    <li>7<span>7个月</span></li>
                    <li>8<span>8个月</span></li>
                    <li>9<span>9个月</span></li>
                    <li>1年<span>1年</span></li&.........完整代码请登录后点击上方下载按钮下载查看

网友评论0