这可能听起来有点愚蠢,但他们是如何获得滑块的: http: //demosthenes.info/blog/757/Playing-With-The-HTML5-range-Slider-Input#volume
当您滑动点时,该数字 (%) 会随着鼠标的移动而立即更新。
为了我自己的“学习目的”,我想知道这怎么可能,因为使用他们在我的网站上提供的相同代码,它不会工作......
;) 谢谢!
更新
我的代码:
<label for=fader>Volume</label>
<input type=range min=0 max=100 value=50 id=fader step=1 onchange="outputUpdate(value)">
<output for=fader id=volume>50%</output>
</output>
<script>
function outputUpdate(vol) {
document.querySelector('#volume').value = vol+"%";
}
</script>