jQuery 和 Rails 图像标记/矩形选择
我脑子里有一个简单的问题,但不知道从哪里开始,而且 JS 也不是我最擅长的。 JavaScript 部分给我带来了麻烦。
我有一个上传的图像,我想将鼠标拖动到该图像上以创建一个矩形并获取矩形坐标。这些坐标应该进入我的 Rails 应用程序数据库,以便稍后向用户显示该矩形,并且所选的图像部分将缩放给用户。
我已经使用过几个在图像上添加标签的 jQuery 插件,但首先它们对于我的需求来说太复杂了,并且无法根据我的具体需求进行定制。
为了获得真实的示例,请参阅此 http://www.stylebistro.com/lookbook/ Tops/PJfJzgo2fN9
这本质上是我想要实现的目标,但管理部分给我带来了麻烦。
问候, 亚沃尔
I have a simple problem in my mind but can't figure out where to start and JS isn't my strongest front. The JavaScript part is what gives me troubles.
I have an uploaded image which I want to drag my mouse upon to make a rectangle and get the rectangle coordinates. Those coordinates should go into my Rails app db so that this rectangle is latter displayed to the user and the image part that is selected will be zoomed to the user.
I've gone through several jQuery plugins that do tagging on images but first of all they are too complex for my needs and can't be customizable to this specific need of mine.
In order to get a real live example please see this http://www.stylebistro.com/lookbook/Tops/PJfJzgo2fN9
It is essentially what I want to achieve but the administration part is giving me troubles.
Regards,
Yavor
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
jCrop 有一个返回图像坐标的 API。它也可以缩放图像,所以它应该很合适。
jCrop has an API that returns image coordinates. It can zoom the image as well, so it should be a good fit.