2016-08-28 5 views
0

내가 작업하는 응용 프로그램에서 jQuery NiceScroll의 사용자 지정 버전을 사용하고 있습니다. 스크롤 막대를 고정하는 요소의 렌더링이 끝나지 않았습니다. 불행히도 요소가 렌더링을 끝내면 스크롤 막대가 올바른 위치에 놓이지 않습니다.unresndered 요소에 nicescroll을 맞추는 방법

내 구현 :

(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

적절한 위치로 스크롤 막대를 얻을 조금 스크롤 한 후.

enter image description here

가 어떻게 요소가 렌더링을 완료 한 후 스크롤 바는, 처음에 적절한 위치에 도달 할 수 ? 사전에

감사

답변

0

당신이 위치

.scroll_class { 
    position: fixed; 
    top: 0; 
    right: 0; 
    bottom: 0; 
} 
에 스타일을 시도 할 수 있습니다