Skip to content
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

Testing resize #42

Closed
bluong opened this issue Jul 8, 2014 · 2 comments
Closed

Testing resize #42

bluong opened this issue Jul 8, 2014 · 2 comments

Comments

@bluong
Copy link

bluong commented Jul 8, 2014

I'm trying to test through resizable, and it seems the easiest way is through simulate? However, in doing so it seems I need to specify pressure, rotation, etc.?

@taye
Copy link
Owner

taye commented Jul 9, 2014

Here's a quick example of how to use resizable to allow resizing of an element: http://codepen.io/taye/pen/xIkdz

interact('.resize')
  .resizeable(true)
  .on('resizemove', function (event) {
    var target = event.target;

    // add the change in coords to the previous width of the target element
    var
      newWidth  = parseFloat(target.style.width ) + event.dx,
      newHeight = parseFloat(target.style.height) + event.dy;

    // update the element's style
    target.style.width  = newWidth + 'px';
    target.style.height = newHeight + 'px';

    target.textContent = newWidth + '×' + newHeight;
  });

Is that what you're looking for?

@taye
Copy link
Owner

taye commented Jul 11, 2014

If what you meant is that you want to fire resize events on an Interactable, I've recently explained this in another issue - #43 (comment).

@taye taye closed this as completed Jul 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants