jQuery鼠標(biāo)懸停內(nèi)容動(dòng)畫切換效果
效果如下:
代碼如下:
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>jQuery鼠標(biāo)懸停內(nèi)容動(dòng)畫切換效果</title> <style> * { margin: 0; padding: 0; list-style: none; } img { border: 0; } a { color: #fff; text-decoration: none; } .servicesBox { width: 1000px; height: 270px; margin: 0 auto; clear: both; line-height: 18px; color: #999999; font-size: 12px; } .servicesBox .serBox { cursor: pointer; border: 1px solid #fff; display: inline; width: 198px; height: 250px; float: left; overflow: hidden; background-color: #f7f7f7; position: relative; } .servicesBox .serBoxOn { font-family: "Microsoft Yahei"; display: none; width: 320px; height: 270px; background: url(http://demo.lanrenzhijia.com/2014/pic0910/images/serboxon_bg.gif) repeat 0px 0px; position: absolute; left: 0px; top: 0px; z-index: 19; } .servicesBox .serBox .pic1 { width: 110px; height: 110px; text-align: center; position: absolute; top: 22px; right: 41px; z-index: 99; } .servicesBox .serBox .pic2 { width: 110px; height: 110px; text-align: center; position: absolute; top: 22px; left: -110px; z-index: 99; } .servicesBox .serBox .txt1 { width: 198px; height: 100px; color: #999999; position: absolute; top: 145px; left: 0px; z-index: 99; } .servicesBox .serBox .txt2 { width: 198px; height: 100px; color: #a9cf4f; position: absolute; top: 145px; right: -240px; z-index: 99; } .servicesBox .serBox span.tit { font-size: 16px; display: block; text-align: center; } .servicesBox .serBox .txt1 .tit { color: #000000; line-height: 30px; } .servicesBox .serBox .txt2 .tit { color: #fff; line-height: 30px; font-family: "Microsoft Yahei"; } .servicesBox .serBox p { padding: 0 10px; text-align: center; } </style> </head> <body> <!-- 代碼begin --> <div class="servicesBox"> <div id="Div35" class="serBox" onclick="serFocus(1)"> <div class="serBoxOn"></div> <div class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/3.png"> </div> <div class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/3-3.png"> </div> <div class="txt1"> <span class="tit">開心網(wǎng)</span> <p>開心網(wǎng)營銷</p> </div> <div class="txt2"> <a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">開心網(wǎng)</span> <p>開心網(wǎng)營銷</p> </a> </div> </div> <div id="Div36" class="serBox" onclick="serFocus(2)"> <div class="serBoxOn"></div> <div class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/1.png"> </div> <div class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/1-1.png"> </div> <div class="txt1"> <span class="tit">人人網(wǎng)</span> <p>人人網(wǎng)營銷</p> </div> <div class="txt2"> <a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">人人網(wǎng)</span> <p>人人網(wǎng)營銷</p> </a> </div> </div> <div id="Div37" class="serBox" onclick="serFocus(3)"> <div class="serBoxOn"></div> <div class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/2.png"> </div> <div class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/2-2.png"> </div> <div class="txt1"> <span class="tit">QQ空間</span> <p>QQ空間營銷</p> </div> <div class="txt2"> <a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">QQ空間</span> <p>QQ空間營銷</p> </a> </div> </div> <div id="Div38" class="serBox" onclick="serFocus(3)"> <div class="serBoxOn"></div> <div class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/35.png"> </div> <div class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/35-35.png"> </div> <div class="txt1"> <span class="tit">問答營銷</span> <p>問答投放 鎖住潛在客戶</p> </div> <div class="txt2"> <a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">問答營銷</span> <p>問答投放 鎖住潛在客戶</p> </a> </div> </div> <div id="Div39" class="serBox" onclick="serFocus(3)"> <div class="serBoxOn"></div> <div class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/31.png"> </div> <div class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/31-31.png"> </div> <div class="txt1"> <span class="tit">郵件推廣</span> <p>低成本 商機(jī)無限</p> </div> <div class="txt2"> <a rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">郵件推廣</span> <p>低成本 商機(jī)無限</p> </a> </div> </div> </div> <script src="http://www.lanrenzhijia.com/ajaxjs/jquery.min.js"></script> <script> $(function() { $(".serBox").hover( function() { $(this).children().stop(false, true); $(this).children(".serBoxOn").fadeIn("slow"); $(this).children(".pic1").animate({ right: -110 }, 400); $(this).children(".pic2").animate({ left: 41 }, 400); $(this).children(".txt1").animate({ left: -240 }, 400); $(this).children(".txt2").animate({ right: 0 }, 400); }, function() { $(this).children().stop(false, true); $(this).children(".serBoxOn").fadeOut("slow"); $(this).children(".pic1").animate({ right: 41 }, 400); $(this).children(".pic2").animate({ left: -110 }, 400); $(this).children(".txt1").animate({ left: 0 }, 400); $(this).children(".txt2").animate({ right: -240 }, 400); } ); }); </script> <!-- 代碼end --> </body> </html>
以上就是本文的全部內(nèi)容,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時(shí)也希望多多支持腳本之家
- jQuery實(shí)現(xiàn)鼠標(biāo)懸停3d菜單展開動(dòng)畫效果
- 基于jquery實(shí)現(xiàn)的鼠標(biāo)懸停提示案例
- jQuery實(shí)現(xiàn)鼠標(biāo)懸停背景翻轉(zhuǎn)的黑色導(dǎo)航菜單代碼
- jQuery實(shí)現(xiàn)鼠標(biāo)懸停顯示提示信息窗口的方法
- 基于jQuery創(chuàng)建鼠標(biāo)懸停效果的方法
- jQuery實(shí)現(xiàn)的感應(yīng)鼠標(biāo)懸停圖片色彩漸顯效果
- 分享33個(gè)jQuery與CSS3實(shí)現(xiàn)的絢麗鼠標(biāo)懸停效果
- jQuery實(shí)現(xiàn)列表自動(dòng)循環(huán)滾動(dòng)鼠標(biāo)懸停時(shí)停止?jié)L動(dòng)
- jQuery當(dāng)鼠標(biāo)懸停時(shí)放大圖片的效果實(shí)例
- jquery鼠標(biāo)懸停導(dǎo)航下劃線滑出效果
相關(guān)文章
Jquery實(shí)現(xiàn)側(cè)邊欄跟隨滾動(dòng)條固定(兼容IE6)
側(cè)邊欄隨滾動(dòng)條上下滾動(dòng),始終固定在一個(gè)位置的功能,現(xiàn)在很多網(wǎng)站和博客都有這個(gè)功能2014-04-04有關(guān)jQuery中parent()和siblings()的小問題
本文通過一個(gè)實(shí)例給大家介紹有關(guān)parent()和siblings()問題原因及解決方案,非常不錯(cuò)具有參考借鑒價(jià)值,感興趣的朋友一起看看吧2016-06-06jQuery實(shí)現(xiàn)平滑滾動(dòng)頁面到指定錨點(diǎn)鏈接的方法
這篇文章主要介紹了jQuery實(shí)現(xiàn)平滑滾動(dòng)頁面到指定錨點(diǎn)鏈接的方法,涉及jquery鼠標(biāo)事件及頁面滾動(dòng)的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-07-07juqery 學(xué)習(xí)之六 CSS--css、位置、寬高
juqery 學(xué)習(xí)之六 CSS--css、位置、寬高,需要的朋友可以參考下。2011-02-02jQuery設(shè)置Easyui校驗(yàn)規(guī)則(推薦)
本文給大家介紹jquery設(shè)置easyui校驗(yàn)規(guī)則的實(shí)現(xiàn)代碼,代碼簡單易懂,非常不錯(cuò),具有參考借鑒價(jià)值,感興趣的朋友一起看看吧2016-11-11jQuery獲取動(dòng)態(tài)添加元素的方法詳解
這篇文章主要介紹了jQuery獲取動(dòng)態(tài)添加元素的方法詳解,jQuery 是一個(gè)高效、精簡并且功能豐富的 JavaScript 工具庫,它提供的 API 易于使用且兼容眾多瀏覽器,這讓諸如 HTML 文檔遍歷和操作、事件處理、動(dòng)畫和 Ajax 操作更加簡單,需要的朋友可以參考下2023-08-08jQuery:節(jié)點(diǎn)(插入,復(fù)制,替換,刪除)操作
jQuery:節(jié)點(diǎn)(插入,復(fù)制,替換,刪除)操作,需要的朋友可以參考一下2013-03-03