Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nashaofu/category
这是一个基于jQuery的分类标签选择列表
https://github.com/nashaofu/category
category jquery tags
Last synced: 25 days ago
JSON representation
这是一个基于jQuery的分类标签选择列表
- Host: GitHub
- URL: https://github.com/nashaofu/category
- Owner: nashaofu
- License: mit
- Created: 2016-09-18T13:43:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-17T01:36:35.000Z (almost 5 years ago)
- Last Synced: 2024-11-09T00:19:34.482Z (3 months ago)
- Topics: category, jquery, tags
- Language: JavaScript
- Homepage: https://nashaofu.github.io/category/demo/
- Size: 52.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# category
这是一个基于jQuery的分类标签选择列表
## 插件示例
[DEMO](https://nashaofu.github.io/category/demo/)
## html
## js
/** 初始化插件 */
$("#category-1").category({
name: "分类1",
data: ["分类1-1", "分类1-2", "分类1-3", "分类1-4", "分类1-5", "分类1-6"]
});
$("#category-2").category({
name: "分类2",
key: "tag",
data: {
tag: {
1: "分类2-1",
2: "分类2-2",
3: "分类2-3",
4: "分类2-4",
5: "分类2-5",
6: "分类2-6",
7: "分类2-7",
8: "分类2-8",
9: "分类2-9",
10: "分类2-10"
}
}
});
$("#category-3").category({
name: "分类3",
key: "category",
data: {
category: ["分类3-1", "分类3-2", "分类3-3", "分类3-4", "分类3-5", "分类3-6"]
}
});
$("#category-4").category({
url: "json/json.json",
key: "category"
});
/** 初始化插件 end */
// 请求远程数据
$("#button-1").click(function() {
$("#category-1").category("getData", {
url: "json/test1.json",
key: "category",
formdata: {
test: "this is a test formdata"
}
});
});
// 显示本地数据,并且数据下标不变
$("#button-2").click(function() {
$("#category-2").category("render", {
data: {
tag: ["本地测试数据1-1", "本地测试数据1-2", "本地测试数据1-3", "本地测试数据1-4", "本地测试数据1-5", "本地测试数据1-6"]
}
});
});
// 请求服务器数据,并改变插件配置
$("#button-3").click(function() {
$("#category-3").category("getData", {
name: "test",
key: 'test',
url: "json/test2.json",
formdata: {
test: 'this is a test formdata'
},
all: {
name: "所有",
value: "all"
}
});
});