竖直的主菜单贴着页面左侧,当光标移入菜单项时,以3D动画的方式弹出对应的二级菜单。
采用jQuery和CSS3实现。支持Chrome,火狐,Edge等浏览器。
效果图:
代码如下:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"> <title>jQuery鼠标悬停3d菜单展开动画 - 何问起</title><base target="_blank" /> <link type="text/css" href="https://hovertree.com/texiao/jquery/93/css/index.css"> </head> <body> <div> <div> <h1><a href="javascript:;" target="_self"><img src="https://hovertree.com/themes/hvtimages/hovertree.png"></a></h1> </div> <p>鼠标移入侧边栏,二级菜单3D展开<br/>鼠标hover背景变色<br />鼠标移入二维码背景变色</p> <div > <a href="https://hovertree.com/">何问起</a> <a href="https://hovertree.com/h/bjag/clwkm5fc.htm" >说明</a> </div> </div> <div> <div> <div> <ul> <li><a href="https://hovertree.com"><span>首页</span></a></li> <li><a href="https://hovertree.com/h/bjaf/lxsexx3m.htm"><span>JavaScript</span></a></li> <li><a href="https://hovertree.com/h/bjaf/l3c6nm7b.htm"><span>ASP.NET</span></a></li> <li><a href="https://hovertree.com/h/bjag/hxti6to6.htm"><span>何问起键盘</span></a></li> <li><a href="https://hovertree.com/h/bjaf/ati6k7yk.htm"><span>HoverClock</span></a></li> <li><a href="https://hovertree.com/about/"><span>关于何问起</span></a></li> </ul> </div> <div> <div></div> <div> <ul> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="https://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> </ul> </div> <div> <ul> <li><a href="https://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="https://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="https://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="https://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="https://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="https://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="https://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="https://hovertree.com/top/"><span>HoverTreeTop</span></a></li> </ul> </div> <div> <ul> <li><a href="https://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="https://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="https://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="https://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="https://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="https://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="https://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="https://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="https://hovertree.com/tiku/"><span>何问起题库</span></a></li> </ul> </div> <div> <ul> <li><a href="https://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="https://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="https://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="https://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="https://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="https://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="https://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="https://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="https://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> </ul> </div> <div></div> </div> </div> </div> <script type="text/javascript" src="https://down.hovertree.com/jquery/jquery-1.9.1.min.js"></script> <script type="text/javascript"> $(function(){ var thisTime; $('.nav-ul li').mouseleave(function(even){ thisTime = setTimeout(thisMouseOut,1000); }) $('.nav-ul li').mouseenter(function(){ clearTimeout(thisTime); var thisUB = $('.nav-ul li').index($(this)); if($.trim($('.nav-slide-o').eq(thisUB).html()) != "") { $('.nav-slide').addClass('hover'); $('.nav-slide-o').hide(); $('.nav-slide-o').eq(thisUB).show(); } else{ $('.nav-slide').removeClass('hover'); } }) function thisMouseOut(){ $('.nav-slide').removeClass('hover'); } $('.nav-slide').mouseenter(function(){ clearTimeout(thisTime); $('.nav-slide').addClass('hover'); }) $('.nav-slide').mouseleave(function(){ $('.nav-slide').removeClass('hover'); }) }) </script> </body> </html>