87,910
社区成员
发帖
与我相关
我的任务
分享
$("#loadDiv").mousemove(function(event){
$("#viewTd").html(event.pageX + ", " + event.pageY);
if (event.which == 1) {
alert("abc");
}
});
<div id="div1" style="height:300px;width:300px;border:3px solid;color:red;">
mouseove & mousedown
</div>
var a = false;//定义全局变量,表示鼠标是否按下
var body = $("body");
body.mousedown(function(){
a=true;
});
div.mouseover(function(){
alert(a);
});
$(funcation)(){
$("body").mousedown(funcation(e){
alert(e.which)
})
}