基于jQuery實(shí)現(xiàn)鼠標(biāo)點(diǎn)擊導(dǎo)航菜單水波動(dòng)畫效果附源碼下載
基于jQuery鼠標(biāo)點(diǎn)擊水波動(dòng)畫豎直導(dǎo)航代碼。這是一款基于jQuery+CSS3實(shí)現(xiàn)的帶動(dòng)畫效果的豎直導(dǎo)航欄特效。效果圖如下:
html代碼:
<div class="nav"> <ul> <li><a>網(wǎng)站首頁</a></li> <li><a>關(guān)于我們</a></li> <li><a>產(chǎn)品中心</a></li> <li><a>成功案例</a></li> <li><a>聯(lián)系我們</a></li> <li><a>在線留言</a></li> </ul> </div> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript"> //jQuery time var parent, ink, d, x, y; $(".nav ul li a").click(function (e) { parent = $(this).parent(); //create .ink element if it doesn't exist if (parent.find(".ink").length == 0) parent.prepend("<span class='ink'></span>"); ink = parent.find(".ink"); //incase of quick double clicks stop the previous animation ink.removeClass("animate"); //set size of .ink if (!ink.height() && !ink.width()) { //use parent's width or height whichever is larger for the diameter to make a circle which can cover the entire element. d = Math.max(parent.outerWidth(), parent.outerHeight()); ink.css({ height: d, width: d }); } //get click coordinates //logic = click coordinates relative to page - parent's position relative to page - half of self height/width to make it controllable from the center; x = e.pageX - parent.offset().left - ink.width() / 2; y = e.pageY - parent.offset().top - ink.height() / 2; //set the position and add class .animate ink.css({ top: y + 'px', left: x + 'px' }).addClass("animate"); }) </script>
以上代碼是本文的核心代碼,比較簡(jiǎn)單,大家可以根據(jù)需求,適當(dāng)?shù)奶砑觿h除代碼。
- jquery實(shí)現(xiàn)鼠標(biāo)點(diǎn)擊后展開列表內(nèi)容的導(dǎo)航欄效果
- jquery點(diǎn)擊頁面任何區(qū)域?qū)崿F(xiàn)鼠標(biāo)焦點(diǎn)十字效果
- jquery實(shí)現(xiàn)可點(diǎn)擊伸縮與展開的菜單效果代碼
- jquery實(shí)現(xiàn)點(diǎn)擊彈出層效果的簡(jiǎn)單實(shí)例
- js點(diǎn)擊出現(xiàn)懸浮窗效果不使用JQuery插件
- jQuery實(shí)現(xiàn)點(diǎn)擊圖片翻頁展示效果的方法
- 基于jQuery的煙花效果(運(yùn)動(dòng)相關(guān))點(diǎn)擊屏幕出煙花
- jquery實(shí)現(xiàn)的點(diǎn)擊翻書效果代碼
- jquery實(shí)現(xiàn)的圖片點(diǎn)擊滾動(dòng)效果
- jquery實(shí)現(xiàn)漂浮在網(wǎng)頁右側(cè)的qq在線客服插件示例
- jQuery實(shí)現(xiàn)鼠標(biāo)點(diǎn)擊處心形漂浮的炫酷效果示例
相關(guān)文章
(模仿京東用戶注冊(cè))用JQuery實(shí)現(xiàn)簡(jiǎn)單表單驗(yàn)證,初學(xué)者必看
下面小編就為初學(xué)者們分享一篇(模仿京東用戶注冊(cè))用JQuery實(shí)現(xiàn)簡(jiǎn)單表單驗(yàn)證,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2018-01-01有關(guān)于eclipse配置spket需要注意的一些地方
用eclipse開發(fā)jquery程序,可以安裝spket插件,這樣在寫代碼的時(shí)候,就會(huì)有智能感知.eclipse配置spket的文章網(wǎng)上到處都是,spket官網(wǎng)上也有介紹.但配置后有的人無論如何也沒有智能感知提示,我就是其中一個(gè).2013-04-04JQuery Ajax如何實(shí)現(xiàn)注冊(cè)檢測(cè)用戶名
這篇文章主要介紹了JQuery Ajax如何實(shí)現(xiàn)注冊(cè)檢測(cè)用戶名,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-09-09一個(gè)簡(jiǎn)單的動(dòng)態(tài)加載js和css的jquery代碼
動(dòng)態(tài)加載js和css的jquery,可用于在生成頁面時(shí)通過js函數(shù)加載一些共通的js和css文件,需要的朋友可以參考下2014-09-09jQuery的ztree仿windows文件新建和拖拽功能的實(shí)現(xiàn)代碼
zTree 是一個(gè)依靠 jQuery 實(shí)現(xiàn)的多功能 “樹插件”。優(yōu)異的性能、靈活的配置、多種功能的組合是 zTree 最大優(yōu)點(diǎn)。這篇文章主要介紹了jQuery的ztree仿windows文件新建和拖拽功能的實(shí)現(xiàn)代碼,需要的朋友可以參考下2018-12-12jQuery實(shí)現(xiàn)復(fù)選框全選/取消全選/反選及獲得選擇的值
這篇文章主要介紹了jQuery實(shí)現(xiàn)的復(fù)選框全選/取消全選/反選及獲得選擇的值,需要的朋友可以參考下2014-06-06