briangonzalez / jquery.pep.js

👟 Pep, a lightweight plugin for kinetic drag on mobile/desktop
http://pep.briangonzalez.org
1.3k stars 178 forks source link

Issue when zooming / using with another library? #183

Closed ghost closed 8 years ago

ghost commented 8 years ago

I wanted to add kinetic / easing to a library I am currently using, svg-pan-zoom.

e.g. http://codepen.io/simonmacfadyen/pen/JXoBqx

As you can see, it works to pan the container, but when the container is zoomed by svg-pan-zoom, the container is hidden/overflow hidden.

Can you see anyway around this? I'd like to add some easing to svg-pan-zoom.

bindea-mihai commented 8 years ago

+1 I am also having problem with dragging an element from a div that has overflow set on it to another div. Because of the overflow, the element disappears. Do you see a workaround here?

Anaphase commented 8 years ago

Well, at least for @simonmacfadyen's CodePen, you can solve the issue by putting overflow: visible; on the SVG element. You could then wrap that whole thing in a fixed size div with overflow: hidden; on it if you wanted:

http://codepen.io/Anaphase/pen/aNjbBy

@bindea-mihai, if you want to provide a simple CodePen demonstrating your use case I'd be happy to take a look.

Joeao commented 8 years ago

@bindea-mihai my solution is to append the element to the body when beginning the drag, setting its new position relative to the window so the placement doesn't jump. Then append it onto the dropzone on release.