时间:2021-07-01 10:21:17 帮助过:2人阅读
//按下鼠标并移动时(拖动),调用的函数;
function startSelection(event){
……
}
//解除移动时的处理函数;
function cancelSelection() {
$(document).unbind('mousemove', startSelection).unbind('mouseup', cancelSelection);
}
//鼠标在按下时调用的函数
function imgMouseDown(event){
$(document).mousemove(startSelection).mouseup(cancelSelection);
}
$img.bind("mousedown",imgMouseDown)