2016-08-28 5 views
0

私が作業するアプリケーションでjQuery NiceScrollのカスタムバージョンを使用しています。 スクロールバーを保持する要素の描画が終了していません。 要素がレンダリングを終了すると、スクロールバーが適切な位置に配置されません。未レンダリング要素に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; 
} 
にそれをスタイルを試すことができます
関連する問題