jQuery實作的圖文高亮滾動切換特效實例_jquery
本文實例講述了jQuery實現的圖文高亮滾動切換特效。分享給大家供大家參考。具體如下:
這裡介紹jQuery圖文高亮滾動切換特效,jQuery滑鼠滑過圖文開關燈切換特效,背景變暗,子內容向上滑動顯示出來,滑鼠的操作感極強,希望大家喜歡本效果。
運作效果截圖如下:
具體程式碼如下:
<!DOCTYPE html> <html lang="en"> <head> <title>jQuery图文高亮滚动切换</title> <style> *{ margin:0; padding:0;} body{ font-family:"宋体"; font-size:12px;text-decoration:none; color:#292929; } h1,h2,h3,h4,h5,h6,p,input,select,td{margin:0;padding:0;} li{list-style:none;} .fl{float:left;} a{text-decoration:none;color:#353535;} img{border:0; vertical-align:top;} .clear{clear:both;} .grid1k { width: 990px; margin: 0 auto; } .grid_full { width: 100%; } .grid1024 { width: 1024px; margin: 0 auto; } .fr { float: right; } .fl { float: left; } .color_blue { color: #29388c; } .color_fff { color: #fff; } .color_333 { color: #333; } .color_666 { color: #666; } .color_999 { color: #999; } .color_orange { color: #e88d27; } .one_fourth_box { display: block; position: relative; width: 326px; height: 135px; margin: 0 2px 2px 0; background: #f6f6f6; overflow: hidden; } .ofb-r { margin-right: 0!important; } .ofb-bg { display: none; width: 100%; height: 100%; position: absolute; z-index: 2; background: #333; } .ofb-img { position: absolute; top: 32px; left: 13px; z-index: 10; } .ofb-img-bottom { position: absolute; top: 160px; left: 13px; z-index: 10; } .ofb-text { position: absolute; top: 25px; left: 144px; width:178px; z-index: 10; } .ofb-text-top { position: absolute; top: -110px; left: 144px; width: 178px; z-index: 10; } .ofb-text h5,.ofb-text-top h5 { font-size: 14px; line-height:16px; } .ofb-text p,.ofb-text-top p { margin-top: 3px; font-size:12px; font-family:"宋体"; line-height:15px; } .ofb-r .ofb-img,.ofb-r .ofb-img-bottom { left: 65px; } .ofb-r .ofb-text,.ofb-r .ofb-text-top { left: 235px; width: 265px; } .color_111{ font-size:14px; color: #999;} .color_222{ font-size:14px; color: #000;} </style> <script src="jquery-1.6.2.min.js"></script> <script> $(function(){ //服务 $('.one_fourth_box').each(function(){ $(this).hover(function(){ $(this).children('.ofb-img').stop(true).animate({top:'-135px'}) $(this).children('.ofb-img-bottom').stop(true).animate({top:'25px'}) $(this).children('.ofb-text').stop(true).animate({top:'160px'}) $(this).children('.ofb-text-top').stop(true).animate({top:'25px'}) $(this).children('.ofb-bg').stop(true,true).fadeIn(); },function(){ $(this).children('.ofb-img').stop(true).animate({top:'25px'}) $(this).children('.ofb-img-bottom').stop(true).animate({top:'160px'}) $(this).children('.ofb-text').stop(true).animate({top:'25px'}) $(this).children('.ofb-text-top').stop(true).animate({top:'-110px'}) $(this).children('.ofb-bg').stop(true,true).fadeOut(); }) }) }) </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head> <body> <div class="grid1k"> <a href="/" class="one_fourth_box fl"> <div class="ofb-bg" style="display: none;"></div> <div class="ofb-img mypng" style="top: 25px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113025969.jpg" width="118" height="78" alt=""></div> <div class="ofb-img-bottom mypng" style="top: 160px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113025969.jpg" width="118" height="78" alt=""></div> <div class="ofb-text" style="top: 25px;"> <h5 class="color_333">节 能/Saving</h5> <p class="color_666">玻璃窗是建筑物中隔热和保温最弱的环节。Sunscape太阳隔热膜能使窗户增加隔热和保 温性能,有助于增加舒适性</p> </div> <div class="ofb-text-top" style="top: -110px;"> <h5 class="color_orange">节 能/Saving</h5> <p class="color_999">玻璃窗是建筑物中隔热和保温最弱的环节。Sunscape太阳隔热膜能使窗户增加隔热和保 温性能,有助于增加舒适性</p> </div> </a> <a href="/" class="one_fourth_box fl"> <div class="ofb-bg" style="display: none;"></div> <div class="ofb-img mypng" style="top: 25px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113025969.jpg" width="118" height="78" alt=""></div> <div class="ofb-img-bottom mypng" style="top: 160px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113025969.jpg" width="118" height="78" alt=""></div> <div class="ofb-text" style="top: 25px;"> <h5 class="color_333">节 能/Saving</h5> <p class="color_666">玻璃窗是建筑物中隔热和保温最弱的环节。Sunscape太阳隔热膜能使窗户增加隔热和保 温性能,有助于增加舒适性</p> </div> <div class="ofb-text-top" style="top: -110px;"> <h5 class="color_orange">节 能/Saving</h5> <p class="color_999">玻璃窗是建筑物中隔热和保温最弱的环节。Sunscape太阳隔热膜能使窗户增加隔热和保 温性能,有助于增加舒适性</p> </div> </a> <a href="/" class="one_fourth_box fl"> <div class="ofb-bg" style="display: none;"></div> <div class="ofb-img mypng" style="top: 25px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113025969.jpg" width="118" height="78" alt=""></div> <div class="ofb-img-bottom mypng" style="top: 160px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113025969.jpg" width="118" height="78" alt=""></div> <div class="ofb-text" style="top: 25px;"> <h5 class="color_333">节 能/Saving</h5> <p class="color_666">玻璃窗是建筑物中隔热和保温最弱的环节。Sunscape太阳隔热膜能使窗户增加隔热和保 温性能,有助于增加舒适性</p> </div> <div class="ofb-text-top" style="top: -110px;"> <h5 class="color_orange">节 能/Saving</h5> <p class="color_999">玻璃窗是建筑物中隔热和保温最弱的环节。Sunscape太阳隔热膜能使窗户增加隔热和保 温性能,有助于增加舒适性</p> </div> </a> <a href="/" class="one_fourth_box ofb-r fl"> <div class="ofb-bg" style="display: none;"></div> <div class="ofb-img mypng" style="top: 25px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113741210.png" alt=""></div> <div class="ofb-img-bottom mypng" style="top: 160px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113518952.png" alt=""></div> <div class="ofb-text" style="top: 25px;"> <h5 class="color_333">移动互联网</h5> <p class="color_666">移动互联网:APP客户端开发,Android、IOS、Winphone 多平台支持</p> </div> <div class="ofb-text-top" style="top: -110px;"> <h5 class="color_orange">移动互联网</h5> <p class="color_999">移动互联网:手机网站建设、APP客户端开发,Android、IOS、Winphone 多平台支持</p> </div> </a> <a href="/" class="one_fourth_box fl"> <div class="ofb-bg" style="display: none;"></div> <div class="ofb-img mypng" style="top: 25px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113138004.png" alt=""></div> <div class="ofb-img-bottom mypng" style="top: 160px;"><img src="http://files.jb51.net/file_images/article/201508/2015810113033195.png" alt=""></div> <div class="ofb-text" style="top: 25px;"> <h5 class="color_333">网站运维</h5> <p class="color_666">您多长时间更新一次网站?每天、每周还是半年...<br> 网站运行的怎么样?给您带来收益了吗?<br> 网站的运营与维护将决定网站的生命质量。</p> </div> <div class="ofb-text-top" style="top: -110px;"> <h5 class="color_orange">网站运维</h5> <p class="color_999">您多长时间更新一次网站?每天、每周还是半年...网站运行的怎么样?给您带来收益了吗?网站的运营与维护将决定网站的生命质量。</p> </div> </a> <a href="/" class="one_fourth_box ofb-r fl"> <div class="ofb-bg" style="display: none;"></div> <div class="ofb-img mypng" style="top: 25px;"><img src="http://files.jb51.net/file_images/article/201508/2015810114041131.png" alt=""></div> <div class="ofb-img-bottom mypng" style="top: 160px;"><img src="http://files.jb51.net/file_images/article/201508/2015810114120324.png" alt=""></div> <div class="ofb-text" style="top: 25px;"> <h5 class="color_333">产品开发</h5> <p class="color_666">互联网功能性平台建设,定制化功能性网站产品销售。</p> </div> <div class="ofb-text-top" style="top: -110px;"> <h5 class="color_orange">产品开发</h5> <p class="color_999">互联网功能性平台建设,定制化网站产品开发服务。</p> </div> </a> </div> <div style="text-align:center;clear:both"><br> </div> </body> </html>
希望本文所述對大家的jquery程式設計有所幫助。

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

jQuery引用方法詳解:快速上手指南jQuery是一個受歡迎的JavaScript庫,被廣泛用於網站開發中,它簡化了JavaScript編程,並為開發者提供了豐富的功能和特性。本文將詳細介紹jQuery的引用方法,並提供具體的程式碼範例,幫助讀者快速上手。引入jQuery首先,我們需要在HTML檔案中引入jQuery函式庫。可以透過CDN連結的方式引入,也可以下載

jQuery中如何使用PUT請求方式?在jQuery中,發送PUT請求的方法與發送其他類型的請求類似,但需要注意一些細節和參數設定。 PUT請求通常用於更新資源,例如更新資料庫中的資料或更新伺服器上的檔案。以下是在jQuery中使用PUT請求方式的具體程式碼範例。首先,確保引入了jQuery庫文件,然後可以透過以下方式發送PUT請求:$.ajax({u

jQuery是一款廣泛應用於前端開發的快速、小巧、功能豐富的JavaScript庫。自2006年發布以來,jQuery已成為眾多開發者的首選工具之一,但在實際應用中,它也不乏一些優點和缺點。本文將深度剖析jQuery的優勢與劣勢,並結合具體的程式碼範例進行說明。優點:1.簡潔的語法jQuery的語法設計簡潔明了,可以大幅提升程式碼的可讀性和編寫效率。比如,

jQuery如何移除元素的height屬性?在前端開發中,經常會遇到需要操作元素的高度屬性的需求。有時候,我們可能需要動態改變元素的高度,而有時候又需要移除元素的高度屬性。本文將介紹如何使用jQuery來移除元素的高度屬性,並提供具體的程式碼範例。在使用jQuery操作高度屬性之前,我們首先需要了解CSS中的height屬性。 height屬性用於設定元素的高度

標題:jQuery小技巧:快速修改頁面所有a標籤的文字在網頁開發中,我們經常需要對頁面中的元素進行修改和操作。使用jQuery時,有時候需要一次修改頁面中所有a標籤的文字內容,這樣可以節省時間和精力。以下將介紹如何使用jQuery快速修改頁面所有a標籤的文本,同時給出具體的程式碼範例。首先,我們需要引入jQuery庫文件,確保在頁面中引入了以下程式碼:<

標題:使用jQuery修改所有a標籤的文字內容jQuery是一款受歡迎的JavaScript庫,被廣泛用於處理DOM操作。在網頁開發中,經常會遇到需要修改頁面上連結標籤(a標籤)的文字內容的需求。本文將介紹如何使用jQuery來實現這個目標,並提供具體的程式碼範例。首先,我們需要在頁面中引入jQuery庫。在HTML檔案中加入以下程式碼:

如何判斷jQuery元素是否具有特定屬性?在使用jQuery操作DOM元素時,常會遇到需要判斷元素是否具有某個特定屬性的情況。在這種情況下,我們可以藉助jQuery提供的方法來輕鬆實現這項功能。以下將介紹兩種常用的方法來判斷一個jQuery元素是否具有特定屬性,並附上具體的程式碼範例。方法一:使用attr()方法和typeof運算子//判斷元素是否具有特定屬

jQuery是一種流行的JavaScript庫,被廣泛用於處理網頁中的DOM操作和事件處理。在jQuery中,eq()方法是用來選擇指定索引位置的元素的方法,具體使用方法和應用場景如下。在jQuery中,eq()方法選擇指定索引位置的元素。索引位置從0開始計數,即第一個元素的索引是0,第二個元素的索引是1,依此類推。 eq()方法的語法如下:$("s
