PHP API接口必備之輸出json格式數據示例代碼
791
2023-12-08
基于jQuery鼠標點擊水波動畫豎直導航代碼。這是一款基于jQuery+CSS3實現的帶動畫效果的豎直導航欄特效。效果圖如下:
效果展示 源碼下載
html代碼:
<div class="nav"> <ul> <li><a>網站首頁</a></li> <li><a>關于我們</a></li> <li><a>產品中心</a></li> <li><a>成功案例</a></li> <li><a>聯系我們</a></li> <li><a>在線留言</a></li> </ul> </div> <script type="text/javascript" src="http://www.gimoo.net/t/1904/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>
以上代碼是本文的核心代碼,比較簡單,大家可以根據需求,適當的添加刪除代碼。
#免責聲明#
本站[綠夏技術導航]提供的一切軟件、教程和內容信息僅限用于學習和研究目的;不得將上述內容用于商業或者非法用途,否則,一切后果請用戶自負。本站信息來自網絡收集整理,版權爭議與本站無關。您必須在下載后的24個小時之內,從您的電腦或手機中徹底刪除上述內容。如果您喜歡該程序或內容,請支持正版,購買注冊,得到更好的正版服務。我們非常重視版權問題,如有侵權請郵件[admin@lxwl520.com]與我們聯系進行刪除處理。敬請諒解!