发文章
发文工具
撰写
网文摘手
文档
视频
思维导图
随笔
相册
原创同步助手
其他工具
图片转文字
文件清理
AI助手
留言交流
经典的Jquery弹出层菜单,附完整代码。预览效果效果网址:http://www./keleyi/phtml/divmenu.htm
jquery添加移除类的两个方法:addClass() 方法向被选元素添加一个或多个类。该方法不会移除已存在的 class 属性,仅仅添加一个或多个 class 属性。提示:如需添加多个类,请使用空格分隔类名。语法$(selector).addClass(class)参数 描述class 必需。规定一个或多个 class 名称。使用函数来添加类使用函数向被选元素添加类。语法$(selector).addClass(function(index,oldclass))removeClass() 方法从被选元素移除一个或多个类。注释:如果没有规定参数,则该方法将从被选元素中删除所有类。语法$(selector).removeClass(class)参数 描述class 可选。规定要移除的 class 的名称。如需移除若干类,请使用空格来分隔类名。如果不设置该参数,则会移除所有类。使用函数来移除类使用函数来删除被选元素中的类。$(selector).removeClass(function(index,oldclass))下面是菜单的完整代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www./TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www./1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>经典:柯乐义jQuery弹出层菜单</title><base target="_blank" /><script type="text/javascript" src="http://www./keleyi/pmedia/jquery-1.8.3.min.js"></script><style type="text/css">body,h1,h2,h3,h4,h5,h6,p,ul,li,dl,dt,dd{padding:0;margin:0;}li{list-style:none;}img{border:none;}em{font-style:normal;}a{color:#555;text-decoration:none;outline:none;}a:hover{color:#000;text-decoration:underline;}body{font-size:12px;font-family:Arial,Verdana, Helvetica, sans-serif;word-break:break-all;word-wrap:break-word;}.clear{height:0;overflow:hidden;clear:both;}.keleyi_com{ margin:100px;}.keleyi_com dl dt{width:70px;position:absolute; z-index:3;padding:0 5px;line-height:20px;}.www_keleyi_com{border:#ccc 1px solid; border-bottom:none;background:#f1f1f1; margin:-1px 0 0 -1px;}.keleyi_com dl dd{ width:110px;position:absolute;z-index:2;border:#ccc 1px solid;padding:5px; line-height:20px; background:#f1f1f1; display:none; margin:19px 0 0 -1px;}.keleyi_com dl dd a{ display:block;border-bottom:#ccc 1px dashed;}</style><script type="text/javascript">$(document).ready(function () {var objStr = ".keleyi_com";$(objStr).each(function (i) {$(this).mouseover(function () {$($(objStr + " dd")[i]).show();$($(objStr + " dt")[i]).addClass("www_keleyi_com");});$(this).hover(function () { }, function () {$($(objStr + " dd")[i]).hide();$($(objStr + " dt")[i]).removeClass("www_keleyi_com");});});});</script></head><body><!-- 【经典】柯乐义弹出层菜单 --><div style="width:400px;margin-left:auto;margin-right:auto;"><div class="keleyi_com"><dl><dt><a href="http://www.">柯乐义菜单</a></dt><dd><a href="http://www./menu/javascript/">Javascript</a><a href="http://www./menu/jquery/">Jquery</a><a href="http://www./menu/csharp/">C#</a><a href="http://www./menu/net/">.NET</a></dd></dl> </div><br /><br />请把光标移到上面菜单上<br /><br />柯乐义提醒您:更多更新特效,请上www.</div></body></html>
来自: 昵称10504424 > 《Jquery》
0条评论
发表
请遵守用户 评论公约
JQuery弹出层,点击按钮后弹出遮罩层,有关闭按钮
</div></body></html>
Jquery鼠标右键点击弹出菜单
今天分享一个Jquery鼠标右键点击弹出菜单的组合功能。在项目中,主要是用在表格中,点击单元格, 弹出右键菜单,选择下一步的功能。 ...
【导航菜单特效】展开合拢的jQuery折叠菜单,手风琴面板
【导航菜单特效】展开合拢的jQuery折叠菜单,手风琴面板。以下是三零网为大家整理的最新【导航菜单特效】展开合拢的jQuery折叠菜单,手风琴面板的文章,希望大家能够喜欢!
利用Jquery.blockui.js创建可拖动、自定义内容的弹出层
利用Jquery.blockui.js创建可拖动、自定义内容的弹出层。jquery.ui.core.js ,jquery.ui.widget.js , jquery.ui.mouse.js , jquery.u...
jQuery框架学习第七天:jQuery动画–jQuery让页面动起来! - 学IT网 x...
开发人员一直痛疼做动画. 但是有了jQuery你会瞬间成为别人(那些不知道jQuery的人)眼里的动画高手! 本文将介绍jQuery的动画相关函数.原来做动画如此简单!基本动画函数: 既有透明度渐变, 又有滑动效果. ...
jQuery 强大的jQuery弹出层插件–BlockUI
jQuery 强大的jQuery弹出层插件–BlockUI经常会有些同志问我有没有好用的基于jQuery的弹出层插件,我通常都会毫不犹豫的推荐他这款插件–BlockUI。BlockUI的下载地址是:hhttp://jquery.malsup.com/blo...
网站开发常用jQuery插件总结(二)弹出层插件Lightbox
网站开发常用jQuery插件总结(二)弹出层插件Lightbox_me.本文介绍的插件Lightbox_me可以完美的支持chrome,firefox和ie7,ie8,ie9等主流浏...
jquery三个关闭弹出层的小示例
div当滚动到页面顶部的时候固定在顶部实例代码
微信扫码,在手机上查看选中内容