简体   繁体   English

输入范围滑块Thumb js事件

[英]input range slider thumb js event

In input range slider I want to increase operable area size will increase when mouse over in thumb. 在输入范围滑块中,当鼠标悬停在拇指上时,我要增加可操作区域的大小。 I have tried this 我已经试过了

HTML HTML

<input id="param1" type="range" min="0" max="1" step="0.1" class="slider-color">

Jquery jQuery的

$('.slider-color::-webkit-slider-thumb').hover(function(){
    $('.slider-color::-webkit-slider-runnable-track').css('height','11px');
});

Please help. 请帮忙。 Above is not working 上面不起作用

I am not sure if you can catch the hover on the slider-thumb but here is an idea in case you want the hover on all the slider where you can rely on CSS variable to change some properties 我不确定是否可以在slider-thumb上悬停,但是如果您希望将鼠标悬停在所有可以依赖CSS变量来更改某些属性的滑块上,则可以使用此方法

 .slider-color:hover { --c:red; --h:40px; } .slider-color::-webkit-slider-runnable-track { background:var(--c,transparent); height:var(--h,initial); } 
 <input id="param1" type="range" min="0" max="1" step="0.1" class="slider-color"> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM