Disable scroll in ion-content [solved]


#1

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


#2

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…


#3

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


#4

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/


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

Works

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


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

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


#7

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