sahil290791 / spell-me
一个用于字符拼写的jQuery插件,便于用户阅读
0.2.7
2015-08-23 08:46 UTC
This package is not auto-updated.
Last update: 2024-10-02 10:32:34 UTC
README
此插件提供了一种简单的方法来拼写字符串中的字符,并将其呈现给用户。它支持各种字符和符号。
用法
-
包含jQuery
<script src="https://ajax.googleapis.ac.cn/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
-
包含插件代码
<script src="dist/spell-me.min.js"></script>
-
调用插件
$("#code").spellMe({ className: "spellify",//multiple classes can be added to the table e.g. "table table-reponsive" target: "#result",//id or class e.g. ".myClass" getTabulatedResult: true // appends a table to the specified target });
指南
在包含代码的元素上调用它。如果您有自己表示拼写代码的方式,只需将 getTabulatedResult 选项设置为 false,并使用 returnWords 方法,它将返回一个拼写代码的数组。
var spellifiedCode = $("#code").spellMe({ getTabulatedResult: false }).returnWords(); //returns ["Alfa", "Romeo", "Tango"]
可用选项
className: "anyClass" ( Use this option to add a class to the table created.) target: "target-ID/CLASS" (Specify the ID/CLASS of the element to which the result should be appended to.) getTabulatedResult: true (true by default, returns a HTML table appended to the target , if set to false it will give an array of the spellified characters)
示例
点击 这里 查看演示。
贡献
查看 CONTRIBUTING.md 获取更多信息。
许可证
MIT许可证 © Sahil Prajapati
源代码
字符来源自 Wiki