您好,登錄后才能下訂單哦!
豎直的主菜單貼著頁(yè)面左側(cè),當(dāng)光標(biāo)移入菜單項(xiàng)時(shí),以3D動(dòng)畫的方式彈出對(duì)應(yīng)的二級(jí)菜單。
采用jQuery和CSS3實(shí)現(xiàn)。支持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鼠標(biāo)懸停3d菜單展開(kāi)動(dòng)畫 - 何問(wèn)起</title><base target="_blank" /> <link rel="stylesheet" type="text/css" > </head> <body> <div class="wrap"> <div class="logo"> <h2><a href="javascript:;" target="_self"><img src="http://hovertree.com/themes/hvtimages/hovertree.png"></a></h2> </div> <p>鼠標(biāo)移入側(cè)邊欄,二級(jí)菜單3D展開(kāi)<br/>鼠標(biāo)hover背景變色<br />鼠標(biāo)移入二維碼背景變色</p> <div > <a >何問(wèn)起</a> <a >說(shuō)明</a> </div> </div> <div class="nav-main"> <div class="nav-box"> <div class="nav"> <ul class="nav-ul"> <li><a class="home"><span>首頁(yè)</span></a></li> <li><a class="develop"><span>JavaScript</span></a></li> <li><a class="wechat"><span>ASP.NET</span></a></li> <li><a class="case"><span>何問(wèn)起鍵盤</span></a></li> <li><a class="news"><span>HoverClock</span></a></li> <li><a class="contact"><span>關(guān)于何問(wèn)起</span></a></li> </ul> </div> <div class="nav-slide"> <div class="nav-slide-o"></div> <div class="nav-slide-o"> <ul> <li><a ><span>hewenqi</span></a></li> <li><a ><span>hewenqi</span></a></li> <li><a ><span>hewenqi</span></a></li> <li><a ><span>hewenqi</span></a></li> <li><a ><span>hewenqi</span></a></li> <li><a ><span>hewenqi</span></a></li> <li><a ><span>hewenqi</span></a></li> <li><a ><span>hewenqi</span></a></li> <li><a ><span>hewenqi</span></a></li> <li><a ><span>hewenqi</span></a></li> </ul> </div> <div class="nav-slide-o"> <ul> <li><a ><span>HoverTreeTop</span></a></li> <li><a ><span>HoverTreeTop</span></a></li> <li><a ><span>HoverTreeTop</span></a></li> <li><a ><span>HoverTreeTop</span></a></li> <li><a ><span>HoverTreeTop</span></a></li> <li><a ><span>HoverTreeTop</span></a></li> <li><a ><span>HoverTreeTop</span></a></li> <li><a ><span>HoverTreeTop</span></a></li> </ul> </div> <div class="nav-slide-o"> <ul> <li><a ><span>何問(wèn)起題庫(kù)</span></a></li> <li><a ><span>何問(wèn)起題庫(kù)</span></a></li> <li><a ><span>何問(wèn)起題庫(kù)</span></a></li> <li><a ><span>何問(wèn)起題庫(kù)</span></a></li> <li><a ><span>何問(wèn)起題庫(kù)</span></a></li> <li><a ><span>何問(wèn)起題庫(kù)</span></a></li> <li><a ><span>何問(wèn)起題庫(kù)</span></a></li> <li><a ><span>何問(wèn)起題庫(kù)</span></a></li> <li><a ><span>何問(wèn)起題庫(kù)</span></a></li> </ul> </div> <div class="nav-slide-o"> <ul> <li><a ><span>網(wǎng)頁(yè)特效</span></a></li> <li><a ><span>網(wǎng)頁(yè)特效</span></a></li> <li><a ><span>網(wǎng)頁(yè)特效</span></a></li> <li><a ><span>網(wǎng)頁(yè)特效</span></a></li> <li><a ><span>網(wǎng)頁(yè)特效</span></a></li> <li><a ><span>網(wǎng)頁(yè)特效</span></a></li> <li><a ><span>網(wǎng)頁(yè)特效</span></a></li> <li><a ><span>網(wǎng)頁(yè)特效</span></a></li> <li><a ><span>網(wǎng)頁(yè)特效</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>
以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,同時(shí)也希望多多支持億速云!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。