Jump to content
Search Community

Wouter11

Members
  • Posts

    3
  • Joined

  • Last visited

Wouter11's Achievements

0

Reputation

  1. Wouter11

    Dynamic Bounds

    Just updated my previous post with a small codepen!
  2. Wouter11

    Dynamic Bounds

    Wowowow. That were some fast replies with great examples! First of all thanks for that! I wasn't aware of the fact that we could set minX and maxX values. The sample didn't really do the trick for me so I rewrote it on my end like this; var lastItemX = lastItem.offsetWidth + lastItem.offsetLeft var minx = -1 * (lastItemX - pageSize.offsetWidth - pageSize.offsetLeft); var maxx = 0; Draggable.get(gallery).applyBounds({minX: minx, maxX: maxx}); So the minX bound is located off screen somewhere on the left based upon the length of the gallery. The maxX is 0 and that seems to hold it in place when dragging to the right. I'm still in doubt about this approach. It works but I'm not so sure if this is the best way to handle it. What I basically have are some offsets on the gallery. It overflows on the right and it should stop when you drag it to far to the left. That is the main issue I'm trying to solve. Update: Was just fiddling around with the example Carl provided and by removing some overflow:hidden I got the exact same effect I was looking for. Will dig into that example a bit more. Update 2: Fiddled a little longer with Carls' example but as soon as I start using relative widths on the slides the logic is breaking. https://codepen.io/wouter125/full/bYpaLO
  3. Wouter11

    Dynamic Bounds

    Hi! Recently I ran into Ueno's website and their about section is using GreenSock to display a gallery of photo's. But the thing is they have their bounds setup in a pretty unique way. The whole draggable section is overflowing but comes to a stop at a certain point. You can experience this by dragging the photo's underneath the "At your service" section. I would like to achieve a similar effect so that it is overflowing but still uses bounds when I scrolled to far. The problem is, I'm not sure where to begin. Anyone that can point me in the right direction or shoot me an example of how to do this? All other examples are using fixed bounds where the draggable layer can move in. If anything is unclear, please notify me and I'll try to extend this post with more info.
×
×
  • Create New...