简体   繁体   English

Ruby on Rails Ajax rubberband

[英]Ruby on Rails Ajax rubberband

I want my users to be able to do a rubberband selection in a image for a Ruby on Rails application. 我希望我的用户能够在图像中为Ruby on Rails应用程序选择橡皮带。 Has anyone seen any good plugins that do this or make it easy for me to implement it? 有没有人见过这样做的好插件或者让我轻松实现它?

I played around with an image cropper that has that feature, and it uses Prototype , so it should be good to go for ROR. 我玩过具有该功能的图像裁剪器 ,它使用Prototype ,所以最好选择ROR。 The code is pretty easy to figure out if you just want the elastic band element. 如果你只想要弹性带元素,代码很容易弄明白。

If you want to roll-your-own it's not too hard to glue a Scriptaculous Draggable object to a DIV and resize/move the DIV. 如果你想自己动手,将Scriptaculous Draggable对象粘贴到DIV并调整大小/移动DIV并不太难。 See my crappy demo . 看看我糟糕的演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM