jQuery实现鼠标悬停3d菜单展开动画效果
2019/6/27 21:28:10
本文主要是介绍jQuery实现鼠标悬停3d菜单展开动画效果,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
竖直的主菜单贴着页面左侧,当光标移入菜单项时,以3D动画的方式弹出对应的二级菜单。
采用jQuery和CSS3实现。支持Chrome,火狐,Edge等浏览器。
效果图:
代码如下:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"> <title>jQuery鼠标悬停3d菜单展开动画 - 何问起</title><base target="_blank" /> <link rel="stylesheet" type="text/css" href="http://hovertree.com/texiao/jquery/93/css/index.css"> </head> <body> <div class="wrap"> <div class="logo"> <h1><a href="javascript:;" target="_self"><img src="http://hovertree.com/themes/hvtimages/hovertree.png"></a></h1> </div> <p>鼠标移入侧边栏,二级菜单3D展开<br/>鼠标hover背景变色<br />鼠标移入二维码背景变色</p> <div style="text-align:center;margin:50px 0; font-size:20px; color:#ffffff;" > <a href="http://hovertree.com/">何问起</a> <a href="http://hovertree.com/h/bjag/clwkm5fc.htm" >说明</a> </div> </div> <div class="nav-main"> <div class="nav-box"> <div class="nav"> <ul class="nav-ul"> <li><a href="http://hovertree.com" class="home"><span>首页</span></a></li> <li><a href="http://hovertree.com/h/bjaf/lxsexx3m.htm" class="develop"><span>JavaScript</span></a></li> <li><a href="http://hovertree.com/h/bjaf/l3c6nm7b.htm" class="wechat"><span>ASP.NET</span></a></li> <li><a href="http://hovertree.com/h/bjag/hxti6to6.htm" class="case"><span>何问起键盘</span></a></li> <li><a href="http://hovertree.com/h/bjaf/ati6k7yk.htm" class="news"><span>HoverClock</span></a></li> <li><a href="http://hovertree.com/about/" class="contact"><span>关于何问起</span></a></li> </ul> </div> <div class="nav-slide"> <div class="nav-slide-o"></div> <div class="nav-slide-o"> <ul> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> <li><a href="http://hovertree.com/texiao/hewenqi/"><span>hewenqi</span></a></li> </ul> </div> <div class="nav-slide-o"> <ul> <li><a href="http://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="http://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="http://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="http://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="http://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="http://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="http://hovertree.com/top/"><span>HoverTreeTop</span></a></li> <li><a href="http://hovertree.com/top/"><span>HoverTreeTop</span></a></li> </ul> </div> <div class="nav-slide-o"> <ul> <li><a href="http://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="http://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="http://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="http://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="http://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="http://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="http://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="http://hovertree.com/tiku/"><span>何问起题库</span></a></li> <li><a href="http://hovertree.com/tiku/"><span>何问起题库</span></a></li> </ul> </div> <div class="nav-slide-o"> <ul> <li><a href="http://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="http://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="http://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="http://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="http://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="http://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="http://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="http://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> <li><a href="http://hovertree.com/menu/texiao/"><span>网页特效</span></a></li> </ul> </div> <div class="nav-slide-o"></div> </div> </div> </div> <script type="text/javascript" src="http://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>
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持找一找教程网!
这篇关于jQuery实现鼠标悬停3d菜单展开动画效果的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-01Vue.js 是什么-icode9专业技术文章分享
- 2024-11-01Vue3入门教程:从零开始搭建第一个Vue3项目
- 2024-11-01详解vueRouter4基础教程
- 2024-11-01Vuex4课程:初学者的完整入门指南
- 2024-10-31Vue3课程:新手入门到初级掌握
- 2024-10-31Vue3课程:新手入门到初级应用详解
- 2024-10-31VueRouter4课程:新手入门与实战指南
- 2024-10-31Vuex4学习:从入门到初级实战教程
- 2024-10-31Vue3教程:新手入门与基础实战
- 2024-10-31Vue教程:新手快速入门指南