How to disable content scrolling?


#22

this is the only option that worked for me as well.
$ionicScrollDelegate.$getByHandle(‘mainScroll’).getScrollView().options.scrollingY = false;

I was getting undefined errors, apparently there’s no .freeze… methods on $ionicScrollDelegate:


#23

Excellent, this works for me.


#24

is it possible to scroll only ng-repeat section - but not the whole view?


#26

Something like this? http://codepen.io/pliablepixels/pen/RWoPOo


#27

Oh yes definitely works like a charm!


#28

Hey max i have all so a problem with scroll bar its automatically always visible even if i create a blank project it used be always without a scroll bar but recently the scroll bar is always visible


#29

This is just in the browser. When running on a real device you won’t have any problem.


#30

You can use $ionicScrollDelegate.freezeAllScrolls(true);

It doesn’t work straight off the bat - you need to wrap it in a $timeout - although I don’t like using timeouts if I can help it so there may may be a better way to do it than this.

This worked for me:

$timeout(function(){
$ionicScrollDelegate.freezeAllScrolls(true);
});

Hope this helps :smile:


#31

my problem is that I want to stop active scrolling on the Formular content.
<ion-content delegate-handle="formularContent" overflow-scroll="true">

$ionicScrollDelegate.$getByHandle(‘formularContent’).freezeAllScrolls(true);
$ionicScrollDelegate.$getByHandle(‘formularContent’).freezeScroll(true);
$ionicScrollDelegate.freezeAllScrolls(true);
$ionicScrollDelegate.$getByHandle(‘formularContent’).getScrollView().options.scrollingY = false;

but the scrolling isn’t stop.

Cordova CLI: 5.4.1
Ionic Version: 1.2.4-nightly-2053
Ionic CLI Version: 1.7.13
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.3
ios-sim version: 5.0.4
OS: Mac OS X El Capitan
Node Version: v4.2.6
Xcode version: Xcode 7.2 Build version 7C68


#32

Hi, i have the same issue here.
Just wrap your call in one $timeout, like:

$timeout(function(){
  $ionicScrollDelegate.$getByHandle('formularContent').freezeScroll(true);
})

#33

Just add

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

to your css or scss file to get rid of the scroll bars while testing in the browser :slightly_smiling:


#34

Hi, sry for the late answer and thanks for help but the active scroll doesn’t stop in iOS.
i think the native scroll is the problem?!

$timeout(function(){
  $ionicScrollDelegate.$getByHandle('formularContent').freezeScroll(true);
})

#35

This worked for me:

$ionicScrollDelegate.$getByHandle(‘scroll-area’).getScrollView().freezeShut(true);

Version 1.7.14

Cheers!


#36

this.$ionicScrollDelegate.freezeAllScrolls(true);


#37

Hello, i can disabled making this:

ion-content .scroll-content{
  overflow-y: hidden;
}

Hope this help you!


#38

Thank you so much, I detected it is okay…
HTML
<ion-content delegate-handle="mainScroll"
JS
//PREVENT SCROLL
$scope.disableVerticalScrolling = function () {
$ionicScrollDelegate.$getByHandle(‘mainScroll’).freezeScroll(true);
}
$scope.enableVerticalScrolling = function () {
$ionicScrollDelegate.$getByHandle(‘mainScroll’).freezeScroll(false);
}


#39

use ngZone. and just put the variable inside the ngZone.run and it will work like charm


#40

It’s working perfectly!!! Thank you so much!!!