3

I am quite new in Angular world. I am working on an application which involves Angular JS. I've been confronted with the requirement to implement custom scrollbar. My application does have jQuery too, but so far most part of my project uses Angular. So should I be using some jQuery widget or implement it via Angular.

If Angular, can you provide me pointers on how should I proceed?

4

2 回答 2

5

您可能应该以 Angular 的方式实现它,即构建/使用自定义 Angular 的指令:

http://docs.angularjs.org/guide/directive

Angular 的学习资源:

https://github.com/jmcunningham/AngularJS-Learning

您始终可以在 Angular 应用程序中使用 jQuery 插件/小部件,但在这种情况下,最好的方法是将每个插件封装在一个指令中。Angular-UI 是一个为多个组件执行此操作的项目,包括 Twitter Bootstrap:

http://angular-ui.github.io/

我知道 angular-perfect-scrollbar,一个简单的 Angular 的完美滚动条指令,但还没有测试过:

https://github.com/itsdrewmiller/angular-perfect-scrollbar

http://www.yuiazu.net/perfect-scrollbar/

于 2014-01-07T04:26:12.490 回答
3

根据您的要求,您可以在 CSS 中严格设置滚动条的样式,而无需任何 JavaScript:

http://css-tricks.com/custom-scrollbars-in-webkit/

于 2013-05-30T19:34:46.260 回答