<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>修改range</title>
    <style>
        .slider-1 {
            width: 600px;
            margin: 200px auto;
        }
        .slider-1 input[type=range] {
            -webkit-appearance: none;
            width: 600px;
            border-radius: 5px;
            background: -webkit-linear-gradient(#F5C057, #F5C057) no-repeat #E6E6E5;
            background-size: 50% 100%;
        }
        .slider-1 input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
        }
        .slider-1 input[type=range]::-webkit-slider-runnable-track {
            height: 10px;
            border-radius: 5px;
        }
        .slider-1 input[type=range]:focus {
            outline: none;
        }
        .slider-1 input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            height: 20px;
            width: 2px;
            margin-top: 0px;
            background: #F7931E;
            cursor: pointer;
        }
        .slider-1 .s-mark {
            margin-top: 17px;
        }
        .slider-1 .s-mark span {
            font-size: 12px;
            color: #3E3A39;
            display: block;
            text-align: center;
        }
        .slider-1 .s-mark span:first-child {
            float: left;
        }
        .slider-1 .s-mark span:nth-child(2) {
            float: right;
        }
    </style>
</head>
<body>
    <div class="slider-1">
        <input type="range" name="rangeMolecular" id="" max="2000" min="0" step="100%" value="" oninput="mark(event)">
        <div class="s-mark">
            <span>0</span>
            <span>2000</span>
            <span>1000</span>
        </div>
    </div>
    <script src="https://cdn.bootcss.com/jquery/3.4.0/jquery.min.js"></script>
    <script>
        function mark() {
            event || (event = window.event);
            $('.slider-1 input[type=range]').val(event.target.value);
            var info = event.target.value / 2000 * 100;
            $('.slider-1 input[type=range]').css('background-size', info + '% 100%');
        }
    </script>
</body>
</html>

改变input[type=range]的样式 动态滑动的更多相关文章

  1. CSS修改input[type=range]滑块样式

    input[type="range"]是html5中的input标签新属性,样子如下: <input type="range" value="4 ...

  2. 美化input type=range标签滑动样式(带渐变效果)

    input原来的样式就不在此赘述了: 下面看一下实际项目中用到的input输入框,同步绑定输入数据,实现输入框双向绑定(实际项目中使用的是vue框架): html部分: <div class=& ...

  3. 【转】自定义(滑动条)input[type="range"]样式

    1.如何使用滑动条? 用法很简单,如下所示: <input type="range" value="0"> 各浏览器原始样式如下: Chrome:  ...

  4. HTML5新特性——自定义滑动条(input[type="range"])

    HTML 4.01 与 HTML5之间的差异 以下 input 的 type属性值是 HTML5 中新增的: color.date.datetime.datetime-local.month.week ...

  5. 改变input type="file" 文字、样式等

    <div class="tac"> <input type="file" id="browsefile" class=&q ...

  6. input type=range 进度条的自定义样式

    /* 自定义进度条样式 */ .v_my input[type=range] { -webkit-appearance: none;/*清除系统默认样式*/ width: .8rem; backgro ...

  7. 自定义input[type="radio"]的样式

    对于表单,input[type="radio"] 的样式总是不那么友好,在不同的浏览器中表现不一. 为了最大程度的显示出它们的差别,并且为了好看,首先定义了一些样式: <fo ...

  8. 自定义input[type="file"]的样式

    input[type="file"]的样式在各个浏览器中的表现不尽相同: 1. chrome: 2. firefox: 3. opera: 4. ie: 5. edge: 另外,当 ...

  9. HTML5中input[type='date']自定义样式

    HTML5提供了日历控件功能,缩减了开发时间,但有时它的样式确实不如人意,我们可以根据下面的代码自行修改. 建议:复制下面的代码段,单独建立一个css文件,方便我们修改. /* 修改日历控件类型 */ ...

随机推荐

  1. redis相关问题记录

    问题:无法在redis自行set操作 错误信息:(error) MISCONF Redis is configured to save RDB snapshots, but is currently ...

  2. GCC中 -I、-L、-l 选项的作用

    在makefile中经常会看到这些选项,gcc默认会在程序当前目录.path路径中查找所需要的材料 如何给gcc添加我们自己的原材料(头文件,库等) -I (注意是大写的i) 给gcc添加自定义的头文 ...

  3. 3ds Max File Format (Part 2: The first inner structures; DllDirectory, ClassDirectory3)

    Now that we understand the outer structure of the file, it's time to look closer to what's inside. T ...

  4. 题解 【洛谷P1115】最大子段和

    这是一道枚举经典题. 本题有三种做法,各位需要根据每个题的数据范围来决定自己用哪种方法. 本题解中统一设最大和为Max. 方法一. 枚举子序列,从起点到终点求和.时间复杂度:O(n^3) 我们可以枚举 ...

  5. vue+muse-ui

    1.可以很好的配合vue2.0开发 2.安装: npm install  muse-ui --save 3.引入: 在main.js中加入 import Vue from 'vue' import M ...

  6. Pytest学习6-跳过或xfail失败的用例

    Skip跳过用例 跳过(Skip)指,你希望如果某些条件得到满足你的测试用例才执行,否则Pytest应该完全跳过运行该用例 1. 跳过测试用例的最简单方法是使用skip装饰器标记它,可以传递一个可选的 ...

  7. 【Python】BMI指数 计算器

    身体质量指数 (Body Mass Index, 简称BMI), 亦称克托莱指数, 是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准.BMI 值超标,意味着你必须减肥了. 在线版:https: ...

  8. sql 应用记录

    SELECT * FROM (select aa.*,bb.mentalvisitid, ' then '家庭访视' else '电话' end as BCSFXS ,bb.visitdate, ' ...

  9. DTW + python 矩阵操作 + debug

    1.  from here. diagonalReturn specified diagonals. diagflatCreate a 2-D array with the flattened inp ...

  10. C语言-数组指针与指针数组

    1.思考 下面这些声明合法吗? int array[5]; int matrix[3][3]; int * pa = array; int * pm = matrix; 问题: array代表数组首元 ...