Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

luneyard

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by luneyard

  1. Hello,

     

    I am trying to build a UI where two arrows – up and down – control the scroll position.

    The scroll element is a Draggable.

    var scroller = $('.scroller.draggable');
    
    Draggable.create(scroller, {
            type:"scrollTop",
            edgeResistance:0.75,
            throwProps:true,
            onDragStart: function() {
                Draggable.get(menu).disable();
            },
            onDragEnd: function() {
                Draggable.get(menu).enable();
            }
        });
    
    $('.icon-arrow-down').on('click', function(event){
            TweenLite.to(scroller, 1, {scrollTo:{y:$scope.yStart}, ease:Power2.easeOut, onComplete:updateYScroll});
            function updateYScroll() {
                console.log(this.scrollY);
                //$scope.yStart = scroller.scrollY + $scope.yIncrement;
            }
        });
    

    But when calling scrollY I always get undefined...

     

    Greetings,

    luneyard

×