JavaScript 进阶营

SelectMenu - 简洁、易用、多样的菜单解决方案

2017-11-27  本文已影响0人  Terry05

SelectPageLogo

简洁、易用、多样的菜单解决方案

入门指南、实例、文档

更多实例、文档请访问:

项目 GitHub 地址:SelectMenu

插件效果预览:

常规菜单模式

SelectMenu1

高级菜单模式

SelectMenu2

高级菜单模式 (多分组数据)

SelectMenu3

安装 / 下载

download SelectMenu plugin zip file by last release, or click me to download SelectMenu
or use NPM

npm install selectmenu

使用手册

插件文件引用

<!-- Basic environment reference -->
<!-- jQuery library include -->
<script type="text/javascript" src="jquery.min.js" >< /script>

<!-- SelectMenu style sheet -->
<link rel="stylesheet" href="selectmenu.css" type="text/css">

<!-- SelectMenu plugin js file include -->
<script type="text/javascript" src="selectmenu.js" >< /script>

HTML元素设置

<!--
Set the trigger menu to open the object, where
only the most commonly used button as an example
-->
<button type="button" id="btnDemo">Select Menu</button>

Javascript初始化

//defined data source
//data format:Array[{Object},{...}]
var data = [
    {id:1 ,name:'Chicago Bulls',desc:'芝加哥公牛'},
    {id:2 ,name:'Cleveland Cavaliers',desc:'克里夫兰骑士'},
    {id:3 ,name:'Detroit Pistons',desc:'底特律活塞'},
    {id:4 ,name:'Indiana Pacers',desc:'印第安纳步行者'}
];
//initialize selectmenu
$('#btnDemo').selectMenu({
    showField : 'desc',
    keyField : 'id',
    data : data
});
上一篇下一篇

猜你喜欢

热点阅读