0

I am using custom version of jQuery NiceScroll in the application I work on. The element which holds the scroll-bar has not finished rendering. Unfortunately the scroll-bar is not placed in the proper position when the element finishes its rendering.

My implementation:

(function (angular) {
    'use strict';

    function myScrollDirective() {
        function linkFunc(scope, element, attrs) {
            var config: any =
                {
                    horizrailenabled: attrs.enableHorizontalScroll ? true : false
                };

            element.niceScroll(config);
        }

        let directive =
            {
                link: linkFunc,
                restrict: 'A'
            };

        return directive;
    }

    angular
        .module('app')
        .directive('myScroll',
        [
            nvScrollDirective
        ]);

})(angular);

enter image description here

After scrolling a bit the scroll-bar gets to the proper position.

enter image description here

How can I make the scroll-bar get to the proper position in the first place, after the element has finished rendering?

Thanks in advance

N.C
  • 21
  • 3

1 Answers1

0

you can try to style it to the position

.scroll_class {
   position: fixed;
   top: 0;
   right: 0;
   bottom: 0;
}
Rudi Urbanek
  • 1,935
  • 1
  • 12
  • 15