| Page 1 of 1 | [ 4 posts ] |
|
Hi,
does anybody know how to define a region when an resize component starts to drag, so it can't drag outside that region. I want to be able to resize and position an element at the same time. Resize element that has the property 'draggable' set to true, but you can drag it all over the window. I don't want that I want to be able to drag only in one specific area - region. I tried everthing but for now i found only a partial solution: resize1.on('dragEvent', function(args) { var xy = YAHOO.util.Dom.getXY('resize1'); if (xy[0]>700) { resize1.setXY('resize1', [700, xy[1]]); // for x } }); The problem is that this doesn't stop the handles from moving. Any clue how to do this? Thanks. |
|
This is not as easy as it should be, I have been working on these hooks for YUI3's DragDrop.
In YUI2, you can take a look at the source of ImageCropper: http://github.com/yui/yui2/blob/master/ ... er.js#L515 It uses resize and constrains itself to the crop area. |
|
Hi,
thanks for replay. I tried to do it in the current implementation - YUI2, I`ll try to fix this if possible. My ideas to solve this: - fire an event/method like 'StopDrag' if possible (for now I think is not possible) - if the position is larger than X remove the drag listener after that add it again (this should stop dragging) - if the position is larger than X try to position all layers used by resize component so it works fine Are this ideas ok, do you have (or anybody) any comments on them. What would be the best solution to use (my last solution is to rewrite the code for YUI3). Thanks!! Dinko. |
|
Hi,
I have similar issue. I need to keep objects inside specific region during resize. I've implemented this feature with same side effect which is present in Image Cropper. When mouse reachs border, proxy element becomes locked in both directions, even when one direction still should be active. Any ideas how to solve that? Thanks, Alexander |
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group