2
我遇到了使用jQuery访问事件的事件坐标的问题。我的代码如下。每当我更改音量滑块时,它将返回undefined而不是光标位置。jQuery e.clientX返回undefined
$(document).ready(function(){
// for new browsers
$("input#volume").bind('input', function(e){
if (is_playing()) {
now_playing.volume = parseFloat((this.value/100));
// set the tooltp for the current volume
var vol_tooltip = Math.floor((this.value/100)*100);
// $(".seek_timer").remove();
console.log(e.clientX);
// $(".slider-wrap").append("<span class='seek_timer'>"+vol_tooltip+"</span>");
// $(".seek_timer").css("left",e.clientX-15+"px");
}
});
});
为什么e.clientX
未定义?
据我所知输入不是鼠标事件,因此它没有鼠标位置。 –