Disable scroll in ion-content [solved]

hi guys , how can i disable scroll in ion-content?
scroll=“false” doesnt work thanks

Normally that should work. But if that is not working try using ionicScrollDelegate in your controller.
Here is a sample ;

$scope.disableVerticalScrolling = function() {
     console.log("disableVerticalScrolling");
     $ionicScrollDelegate.getScrollView().options.scrollingY = false;
     $window.localStorage["Scroll"] = JSON.stringify(false);
}

$scope.enableVerticalScrolling = function() {
     console.log("enableVerticalScrolling");
     $ionicScrollDelegate.getScrollView().options.scrollingY = true;
     $window.localStorage["Scroll"] = JSON.stringify(true);
}

Hope this helps…

1 Like

hi, this look like as an ionic1 code, i’m looking for an ionic2 solution

Well I have not used ionic 2 yet, but based on a quick research, maybe this will help :
http://ionicframework.com/docs/api/directive/ionContent/

::-webkit-scrollbar,
    *::-webkit-scrollbar {
      display: none;
    }

Works

my question is a duplicate please see how to disable scroll in ion-content

    var stopScroll = function(){
        $('.scroll').addClass('no-scroll');
    }
    var startScroll = function(){
        $('.scroll').removeClass('no-scroll');
    }

.no-scroll{
transform: none !important;
}

Answer found in this post
https://forum.ionicframework.com/t/how-to-disable-scroll-of-an-ion-content?source_topic_id=48272

.. incude fixed content