小编Aam*_*eer的帖子

通过jquery更改webkit-slider-thumb的背景图片

我搜索了一会儿,但找不到任何有用的东西.我有以下的CSS

 input[type="range"]::-webkit-slider-thumb {
       -webkit-appearance: none;
         width: 20px;
         height: 20px;
         border-radius: 10px;
         background-image: url('http://www.w3schools.com/html/smiley.png'),
         -webkit-gradient(
             linear,
             left top,
             left bottom,
             color-stop(0, #fefefe),
             color-stop(0.49, #dddddd),
             color-stop(0.51, #d1d1d1),
             color-stop(1, #a1a1a1)
         );
         background-size:20px;
         background-repeat: no-repeat;
Run Code Online (Sandbox Code Playgroud)

}

现在我想通过jquery或普通javascript的帮助将背景图像更改为其他图像src,我可以从chrome console中测试.所以我有类似的东西:

`background-image: url('http://someotherimage/test.png'),`
Run Code Online (Sandbox Code Playgroud)

任何人都可以提到正确的语法.感谢您的好评.

javascript css jquery html5 background-image

2
推荐指数
2
解决办法
5885
查看次数

标签 统计

background-image ×1

css ×1

html5 ×1

javascript ×1

jquery ×1