pageX/pageY,screenX/screenY,clientX/clientY的差别

时间:2022-01-10 15:14:33

pageX/pageY,screenX/screenY,clientX/clientY的差别

pageX/pageY,screenX/screenY,clientX/clientY的差别

$(document).click(function(e){

//x方向无差别
//alert(e.pageX+','+e.screenX+','+e.clientX);
//y方向有差别,无滚动条时pageY和clientY一样,有的话三者有差别
alert(e.pageY+','+e.screenY+','+e.clientY);

});