jquery实现折叠菜单鼠标感应弹出特效

5个月前 (04-13 12:51)阅读回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值5294
  • 级别管理员
  • 主题1058
  • 回复2
楼主

jquery实现折叠菜单鼠标感应带缓冲弹出效果,当用户的鼠标经过时弹出二级菜单,可根据自己的需求来自定义。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren">
<meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。">
<title>jquery实现折叠菜单鼠标感应弹出特效_武鸣人</title>
<SCRIPT src="/img/jquery_wuming_ren.js" type=text/javascript></SCRIPT>
<SCRIPT>
var menu_wwwwumingren=function(){
var t=15,z=50,s=6,a;
function dd(n){this.n=n; this.h=[]; this.c=[]}
dd.prototype.init=function(p,c){
a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0;
for(i;i<l;i++){
var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i];
h.onmouseover=new Function(this.n+'.st('+i+',true)');
h.onmouseout=new Function(this.n+'.st('+i+')');
}
}
dd.prototype.st=function(x,f){
var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0];
clearInterval(c.t); c.style.overflow='hidden';
if(f){
p.className+=' '+a;
if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0}
if(c.mh==c.offsetHeight){c.style.overflow='visible'}
else{c.style.zIndex=z; z++; c.t=setInterval(function(){sl(c,1)},t)}
}else{p.className=p.className.replace(a,''); c.t=setInterval(function(){sl(c,-1)},t)}
}
function sl(c,f){
var h=c.offsetHeight;
if((h<=0&&f!=1)||(h>=c.mh&&f==1)){
if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'}
clearInterval(c.t); return
}
var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh;
c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')';
c.style.height=h+(d*f)+'px'
}
return{dd:dd}
}();//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
</SCRIPT>
<style type="text/css">
a{text-decoration:none}
.menu_wwwwumingren ul{
  margin:0 0 0 10px;
  padding:0;
  display:none;
}
.menu_wwwwumingren ul li{
  height:22px;
  line-height:22px;
  border:none;
}
.menu_wwwwumingren ul li a{
  font-size:12px;
  font-weight:normal;
  color:#666;
}
.menu_wwwwumingren ul ul{
  position:absolute;
  z-index:3;
  background:#CC3366;
}
.menu_wwwwumingren ul ul li{text-indent:10px;padding-right:10px}
.menu_wwwwumingren ul ul li a{color:#fff}
</style>
</head>
<body>
<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script>
需要加载js文件,请刷新后看效果。
 <ul class="menu_wwwwumingren" id="menu_wwwwumingren">
    <li><a href="https://www.wuming.ren">武鸣人一号菜单</a>
      <ul>
        <li><a href="https://www.wuming.ren">武鸣人一号菜单一</a></li>
        <li><a href="https://www.wuming.ren">武鸣人一号菜单二</a></li>
        <li><a href="https://www.wuming.ren">武鸣人一号菜单三</a></li>
        <li><a href="https://www.wuming.ren">武鸣人一号菜单四</a></li>
        <li><a href="https://www.wuming.ren">武鸣人一号菜单五</a></li>
        <li><a href="https://www.wuming.ren">武鸣人一号菜单六</a></li>
      </ul>
    </li>  
    <li><a href="https://www.wuming.ren">武鸣人二号菜单</a>
    <ul>
        <li><a href="https://www.wuming.ren">武鸣人二号菜单一</a>
          <ul>
            <li><a href="https://www.wuming.ren">武鸣人三级菜单一</a></li>
            <li><a href="https://www.wuming.ren">武鸣人三级菜单二</a></li>
          </ul>
        </li>
        <li><a href="https://www.wuming.ren">武鸣人二号菜单二</a></li>
      </ul>
    </li>
 </ul>
 <SCRIPT type=text/javascript> 
var menu_wwwwumingren=new menu_wwwwumingren.dd("menu_wwwwumingren");
menu_wwwwumingren.init("menu_wwwwumingren","menuhover");
</SCRIPT>
</body>
</html>


0
0
收藏0

本文来自武鸣人网站,转载请注明出处

本文地址:https://www.wuming.ren/a/720.html

回帖

jquery实现折叠菜单鼠标感应弹出特效 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息