angular-nice-barAngular 滚动条

联合创作 · 2023-09-19 12:57

一个轻量级的 Angular scrollbar.


Install



bower install angular-nice-bar --save

Usage



<link rel="stylesheet" href="bower_components/angular-nice-bar/dist/css/angular-nice-bar.css" />

<script src="bower_components/angular-nice-bar/dist/js/angular-nice-bar.js"></script>


angular.module('app', ['ngNiceBar']);

As a directive



angular.module('app', ['foPopover']);


<div nice-bar nice-bar-delay="1000" nice-bar-theme="dark">  <!-- content here--></div>

As a service



<div id="container">  <!-- content here--></div>


angular.module('app', ['ngNiceBar'])
.controller('HomeCtrl', function($scope, niceBar) {  $timeout(function() {    niceBar.init(document.getElementById('container'));
  }, 10);
});

Custom theme


You can custom scrollbar style with CSS easily:



.nice-bar .nice-bar-slider-y {  background: #222;  /* whatever */}
浏览 11
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报