首页 技术 正文
技术 2022年11月14日
0 收藏 620 点赞 3,791 浏览 3273 个字

插件名:柯乐义
英文名:Keleyi
js文件名称:jquery.keleyi.js
插件功能:该插件可以让你轻易地在页面上构建一个向上弹出的二级菜单。

示例查看:http://keleyi.com/keleyi/

更多示例:0 1 2 3 4 5 6 7 8 9 10 11 12

从示例可以看出,Keleyi这个菜单插件使用方便,可以灵活自定义多种样式,包括颜色,位置,菜单项宽度等等。

下面给出一个示例的HTML文件代码:

 <!DOCTYPE html>
<html>
<head>
<title>Keleyi(jQuery Menu Plugin) - keleyi.com</title><base target="_blank" />
<script type="text/javascript" src="http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></script>
<link href="http://keleyi.com/keleyi/demo/keleyi.css" rel="external nofollow" rel="external nofollow" type="text/css" rel="Stylesheet" />
<style>
body
{
margin: 0px;
overflow:scroll;
}
</style>
</head>
<body>
<div style="text-align:center"><h1>Keleyi</h1>
A jQuery Menu Plugin
</div>
<div style="height:360px;background-color:#66FF66;"></div>
<ul id="keleyi-menu">
<li><a href="http://keleyi.com" rel="external nofollow" rel="external nofollow" >Home</a></li>
<li><a href="http://keleyi.com/menu/webqd/" rel="external nofollow" >Web</a>
<ul>
<li><a href="http://keleyi.com/menu/javascript/" rel="external nofollow" >Javascript</a></li>
<li><a href="http://keleyi.com/menu/jquery/" rel="external nofollow" >jQuery</a></li>
<li><a href="http://keleyi.com/menu/html5/" rel="external nofollow" >HTML5</a></li>
</ul>
</li>
<li><a href="http://keleyi.com/keleyi/" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Keleyi</a></li>
<li><a href="http://keleyi.com/keleyi/demo/" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Demo</a>
<ul>
<li><a href="http://keleyi.com/keleyi/demo/1.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Demo 1</a></li>
<li><a href="http://keleyi.com/keleyi/demo/2.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Demo 2</a></li>
<li><a href="http://keleyi.com/keleyi/demo/3.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Demo 3</a></li>
<li><a href="http://keleyi.com/keleyi/demo/4.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Demo 4</a></li>
<li><a href="http://keleyi.com/keleyi/demo/5.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Demo 5</a></li>
<li><a href="http://keleyi.com/keleyi/demo/6.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Demo 6</a></li>
<li><a href="http://keleyi.com/keleyi/demo/7.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Demo 7</a></li>
</ul>
</li>
<li><a href="http://keleyi.com/keleyi/demo/8.htm" rel="external nofollow" rel="external nofollow" >Demo 8</a></li>
<li><a href="http://keleyi.com/keleyi/demo/9.htm" rel="external nofollow" rel="external nofollow" >Demo 9</a></li>
</ul>
<div style="height:900px; visibility: visible; background-color:Olive">
</div>
<script type="text/javascript" src="http://keleyi.com/keleyi/demo/jquery.keleyi.js"></script>
<script type="text/javascript">
$("#keleyi-menu").keleyi({ "item_width": "100px", "bar_position": "relative"
, "margin": "0px auto 0px 0px"
});
</script>
</body>
</html>

插件的使用一:
使用这个插件,需要引用这3个文件(一个CSS文件,一个jQuery库,和一个插件js文件):

 <link href="http://keleyi.com/keleyi/demo/keleyi.css" rel="external nofollow"  rel="external nofollow"  type="text/css" rel="Stylesheet" />
<script type="text/javascript" src="http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://keleyi.com/keleyi/demo/jquery.keleyi.js"></script>

插件的使用二:
从上面的代码看出,这个菜单的HTML代码非常简洁,格式如下:

 <ul id="keleyi-menu"> <li><a href="http://keleyi.com" rel="external nofollow"  rel="external nofollow" >主菜单项一</a></li>
<li><a href="http://keleyi.com/keleyi/" rel="external nofollow" rel="external nofollow" rel="external nofollow" >主菜单项二</a></li> <li><a href="http://keleyi.com/keleyi/demo/" rel="external nofollow" rel="external nofollow" rel="external nofollow" >主菜单项三</a>
<ul>
<li><a href="http://keleyi.com/keleyi/demo/1.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >子菜单项1</a></li>
<li><a href="http://keleyi.com/keleyi/demo/2.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >子菜单项2</a></li>
<li><a href="http://keleyi.com/keleyi/demo/3.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >子菜单项3</a></li>
<li><a href="http://keleyi.com/keleyi/demo/4.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >子菜单项4</a></li>
<li><a href="http://keleyi.com/keleyi/demo/5.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >子菜单项5</a></li>
<li><a href="http://keleyi.com/keleyi/demo/6.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >子菜单项6</a></li>
<li><a href="http://keleyi.com/keleyi/demo/7.htm" rel="external nofollow" rel="external nofollow" rel="external nofollow" >子菜单项7</a></li>
</ul>
</li> </ul>

插件的使用三:
然后就是定义菜单的代码:

 <script type="text/javascript">
$("#keleyi-menu").keleyi({ "item_width": "100px", "bar_position": "relative"
, "margin": "0px auto 0px 0px"
});
</script>

这样就可以在页面上显示一个特别的向上弹出菜单了。

原文:http://keleyi.com/a/bjac/c4oc8tyo.htm

web前端:http://www.cnblogs.com/jihua/p/webfront.html

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,111
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,584
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,431
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,203
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,838
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,922