Jump to content
Search Community

Draggable set right Padding in horizontal drag

LucitheR test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi there, 

 

i have two containers inside a horizontal draggable Div. positioned by flex-box

 

inside the second Div i have some  absolute positioned  items that might be wider than said container.

it's trivial to get the widths of those elements. and set the right padding.

 

But when i start dragging that number is overwritten by draggable. i tried onPress, startDrag(). How do i set that Padding initially and persistently?

 

in the screenshots:

 

grey background: correct 

 

5a1bf322deca2_ScreenShot2017-11-27at12_11_53.thumb.jpg.c3f9c90207e1f345ef0bdc3ea02ba921.jpg

 

blue background: incorrect after dragging

 

5a1bf323e692d_ScreenShot2017-11-27at12_11_29.thumb.jpg.e015505827fa8b10b6985c39e3b4694e.jpg 

 

 What am i doing wrong? how does draggable calculate its padding-right?

 

Sorry that i can't make a codepen, but its wip on an ongoing project

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...