实现自定义滚动条 [英] Implementing custom scrollbar

查看:85
本文介绍了实现自定义滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Angular世界中很陌生.我正在开发一个涉及Angular JS的应用程序.我一直面临实现自定义滚动条的要求.我的应用程序也有jQuery,但是到目前为止,我的项目的大部分使用了Angular.因此,我应该使用一些jQuery小部件还是通过Angular实现它.

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.

如果是Angular,您能为我提供有关如何进行的指导吗?

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

推荐答案

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

You should probably implement it in the Angular way, i.e., building / using a custom Angular's directive:

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

学习Angular的资源:

Learning resources for Angular:

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

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

You can always use jQuery plugins / widgets in an Angular app, but in that case the best way is to encapsulate each plugin within a directive. Angular-UI is a project which does that for several components, including Twitter Bootstrap:

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

我知道angular-perfect-scrollbar,它是Angular的一个完美的scrollbar指令,但尚未对其进行测试:

I'm aware of angular-perfect-scrollbar, a simple Angular's directive for perfect-scrollbar, but haven't tested it yet:

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

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

这篇关于实现自定义滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆