如何将插件添加到Bootstrap [英] How to add plugins to Bootstrap
问题描述
我发现测试密码强度的Bootstrap 插件非常酷。它看起来很好,我想使用它,但我无法弄清楚如何使它工作。根据Github页面,你要做的就是只需要在你想要附加强度计的密码字段上调用插件。。不幸的是,他们没有告诉你在哪里放置文件,也没有告诉你实际需要使用哪些javascript文件。
I found this really cool plugin for Bootstrap that measures password strength. It looks good, and I want to use it, but I can't figure out how to make it work. According to the Github page, all you have to do to use it is "Just invoke the plugin on the password fields you want to attach a strength meter to.". Unfortunately, they don't tell you where to put the files, nor which javascript files you actually need to use.
我一直在谷歌搜索每一种可能的迭代方式添加或安装Bootstrap的插件,每次都是空的。有人在这里有答案吗?
I've been Googling every possible iteration of ways to add or install plugins for Bootstrap, and have come up empty each time. Does anyone have an answer here?
推荐答案
我猜github页面可能会混淆所有这些源文件。您需要做的就是从此页面获取最新的缩小文件:
I guess the github pages can be confusing with all those source files. All you need to do is get the latest minified file from this page:
https://github.com/ablanco/jquery.pwstrength.bootstrap/tree/master/dist
下载,上传,然后使用
<script type="text/javascript" src="file/location/pwstrength-bootstrap-1.2.3.min.js"></script>
完成后,添加以下javascript代码以调用类或元素上的插件:
When you've done that, add the following javascript code to invoke the plugin on a class or element:
$(document).ready(function(){
$(':password').pwstrength();
});
这篇关于如何将插件添加到Bootstrap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!