开发者

disable default behavior of image when try to move in in browser

i'm finishing writing a plugin, which allow to开发者_运维问答 zoom images, and then move it, to see other parts of image. But i have a problem.

as we know, when we try to move image, (ie when we mousedown on it and move the cursor), the browser don't allow it.

i've written

$("img").mousedown(function(e)
{
   e.preventDefault();
});

and it works in Mozilla, but doesn't for example in ie.

any ideas?

Thanks much


You can sort out IE by also adding e.preventDefault() to your document's mousemove event handler:

$(document).mousemove(function(e){ 
    e.preventDefault();
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜