Jump to content
Search Community

eguneys

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by eguneys

  1. Draggable.create("#scrollThumb", {
      type: "y",
      bounds: "#scrollTrack",
      onDrag: function() {
        var delta = pointerEvent.movementY;
    
        // use delta to scroll page
      }
    }
    

    This code works fine mostly to build a scrollbar. But it moves the page a little more than usual if I drag faster. What could be a better way to prevent this issue?

  2. I have a Draggable, it is bounded to a container like this:

      Draggable.create(t, {type:"x,y", bounds:container, throwProps:true, liveSnap: false, snap: {
        x: function(endValue) {
          return Math.round(endValue / 38) * 38;
        },
        y: function(endValue) {
          return Math.round(endValue / 50) * 50;
        }
      }});
    
    

    But I want to shrink the bounds within the container. How can I give an offset to the bounded container? Another approach is to define a dummy container that fits exactly within required bounds, but that's a little more work.

×
×
  • Create New...