在裁剪区域外禁用鼠标单击 [英] Disable mouse click outside cropped region

查看:102
本文介绍了在裁剪区域外禁用鼠标单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用jquery jcrop裁剪图像。

I'm trying to use jquery jcrop to crop images.

此代码启动插件,以aspcet比率将一些选定区域添加到图像中。

this code starts the plugin adding some selected area to the image with aspcet ratio.

$('#cropbox').Jcrop(
{
setSelect:   [ 100, 100, 50, 50 ],
aspectRatio: 16 / 9
});

但如果用户在其他地方的图像上单击鼠标,则选择消失。所以我想要的是在这个插件中禁用鼠标点击,这样选定的区域将保留在图像上。

But if user clicks mouse on image somewhere else, the selection disappears. So what I want is to disable mouse clicks in this plugin so selected area will remain over the image.

推荐答案

解决方案

我收到了电子邮件,我的请求是jcrop的创建者,这解决了问题

I've received email on my request to the creators of jcrop and that solved the problem

这是解决方案

首先必须有一些setSelect,所以总是从一开始就选择一些区域。

First there must be some setSelect , so some area is always selected from the beginning.

这个 allowSelect:false 阻止鼠标点击,并将选定区域始终保持在图像上。

And this allowSelect: false prevents mouse clicks, and keeps selected area always over the image.

这篇关于在裁剪区域外禁用鼠标单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆