-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resizable handle outside the target element #188
Comments
I can't make a full demo now. The general idea is to listen for <!-- Resize handle.
the data-[edge] attributes hold the edges that the handle can resize -->
<div class="resize-handle" data-right="true" data-bottom="true"></div>
<!-- The element that the handle resizes -->
<div id="resizable-element"></div> interact('#resize-element').resizable(...);
interact('.resize-handle').on('down', function (event) {
var interaction = event.interaction,
handle = event.currentTarget;
interaction.start({
name: 'resize',
edges: {
top : handle.dataset.top,
left : handle.dataset.left,
bottom: handle.dataset.bottom,
right : handle.dataset.right,
}
},
interact('#resizable-element'), // target Interactable
document.getElementByID('resize-element')); // target Element
}); I didn't test the code above by the way. |
Here is a working demo http://codepen.io/taye/pen/pJWQRx. |
Could something like this be added to the library? Making it clear that an object is resizable would help with discoverability. Maybe an option of add handles in |
I feel that that's something that should be implemented in a separate library on top of interact.js so I'm against adding it directly. I might change my mind in the future but I don't think that it's likely. And by the way, I've improved that demo a little. |
@taye the demo ([http://codepen.io/taye/pen/pJWQRx]) doesn't work. why? |
I was able to get the codepen to work by editing the interact library. I might make a PR for this change. It looks like pointers is a required parameter for setEventXY. |
Once I've started down this road.... |
See taye#188 (comment) and taye#459 for more information.
See #188 (comment) and #459 for more information.
How i can place resizable handle outside the target element regarding draggable example below? I can't find any working example, help please.
The text was updated successfully, but these errors were encountered: