JQUERY THICKBOX彈出層插件
更新時(shí)間:2008年08月30日 19:29:22 作者:
JQUERY插件THICKBOX的功能很強(qiáng)大,但是它的基本使用卻很簡(jiǎn)單容易.但是要研究的更深,運(yùn)用得更加靈活的話,還是有點(diǎn)難度,根據(jù)其官方站點(diǎn)介紹
.THICKBOX支持一下瀏覽器:
Windows IE 6.0, Windows IE 7+, Windows FF 2.0.0.6+, Windows Opera 9.0+, Macintosh Safari 2.0.4+, Macintosh FF 2.0.0.6+, Macintosh Opera 9.10……但是據(jù)我的使用,IE6還是有點(diǎn)問(wèn)題的!下面我們首先來(lái)看它的調(diào)用:
1.肯定你先要下載jquery.js和thickbox.js了.還有thickbox.css也不能少!
<script type="text/javascript" src="path-to-file/jquery.js"></script>
<script type="text/javascript" src="path-to-file/thickbox.js"></script>
<link rel="stylesheet" href="path-to-file/thickbox.css" type="text/css" media="screen" />
//path-to-file 就是你放這三個(gè)文件的路徑
2.彈出單張圖片的方法:
<a href="images/single.jpg" title="add a caption to title attribute / or leave blank" class="thickbox"><img src="images/single_t.jpg" alt="Single Image"/></a>
3.多張圖片實(shí)現(xiàn)分頁(yè)也很簡(jiǎn)單:
<a href="images/plant1.jpg" title="add a caption to title attribute / or leave blank" class="thickbox" rel="gallery-plants"><img src="images/plant1_t.jpg" alt="Plant 1" /></a>
<a href="images/plant2.jpg" title="add a caption to title attribute / or leave blank" class="thickbox" rel="gallery-plants"><img src="images/plant2_t.jpg" alt="Plant 2" /></a>
<a href="images/plant3.jpg" title="add a caption to title attribute / or leave blank" class="thickbox" rel="gallery-plants"><img src="images/plant3_t.jpg" alt="Plant 3" /></a>
<a href="images/plant4.jpg" title="add a caption to title attribute / or leave blank" class="thickbox" rel="gallery-plants"><img src="images/plant4_t.jpg" alt="Plant 4" /></a>
4.彈出網(wǎng)頁(yè)inLINECONTENT
<input alt="#TB_inline?height=300&width=400&inlineId=myOnPageContent" title="add a caption to title attribute / or leave blank" class="thickbox" type="button" value="Show" />
//重要的是 #TB_inline?
5.iFRAME形式的
<a href="ajax.PHP?keepThis=true&TB_iframe=true&height=250&width=400" title="add a caption to title attribute / or leave blank" class="thickbox">Example</a>
所有調(diào)用的樣式都得加上class=”thickbox”.這是控制彈出的效果,具體可以參照J(rèn)QUERY的官方站點(diǎn)對(duì)THICKBOX的介紹,里面有具體效果:http://jquery.com/demo/thickbox/
Windows IE 6.0, Windows IE 7+, Windows FF 2.0.0.6+, Windows Opera 9.0+, Macintosh Safari 2.0.4+, Macintosh FF 2.0.0.6+, Macintosh Opera 9.10……但是據(jù)我的使用,IE6還是有點(diǎn)問(wèn)題的!下面我們首先來(lái)看它的調(diào)用:
1.肯定你先要下載jquery.js和thickbox.js了.還有thickbox.css也不能少!
復(fù)制代碼 代碼如下:
<script type="text/javascript" src="path-to-file/jquery.js"></script>
<script type="text/javascript" src="path-to-file/thickbox.js"></script>
<link rel="stylesheet" href="path-to-file/thickbox.css" type="text/css" media="screen" />
//path-to-file 就是你放這三個(gè)文件的路徑
2.彈出單張圖片的方法:
復(fù)制代碼 代碼如下:
<a href="images/single.jpg" title="add a caption to title attribute / or leave blank" class="thickbox"><img src="images/single_t.jpg" alt="Single Image"/></a>
3.多張圖片實(shí)現(xiàn)分頁(yè)也很簡(jiǎn)單:
復(fù)制代碼 代碼如下:
<a href="images/plant1.jpg" title="add a caption to title attribute / or leave blank" class="thickbox" rel="gallery-plants"><img src="images/plant1_t.jpg" alt="Plant 1" /></a>
<a href="images/plant2.jpg" title="add a caption to title attribute / or leave blank" class="thickbox" rel="gallery-plants"><img src="images/plant2_t.jpg" alt="Plant 2" /></a>
<a href="images/plant3.jpg" title="add a caption to title attribute / or leave blank" class="thickbox" rel="gallery-plants"><img src="images/plant3_t.jpg" alt="Plant 3" /></a>
<a href="images/plant4.jpg" title="add a caption to title attribute / or leave blank" class="thickbox" rel="gallery-plants"><img src="images/plant4_t.jpg" alt="Plant 4" /></a>
4.彈出網(wǎng)頁(yè)inLINECONTENT
復(fù)制代碼 代碼如下:
<input alt="#TB_inline?height=300&width=400&inlineId=myOnPageContent" title="add a caption to title attribute / or leave blank" class="thickbox" type="button" value="Show" />
//重要的是 #TB_inline?
5.iFRAME形式的
復(fù)制代碼 代碼如下:
<a href="ajax.PHP?keepThis=true&TB_iframe=true&height=250&width=400" title="add a caption to title attribute / or leave blank" class="thickbox">Example</a>
所有調(diào)用的樣式都得加上class=”thickbox”.這是控制彈出的效果,具體可以參照J(rèn)QUERY的官方站點(diǎn)對(duì)THICKBOX的介紹,里面有具體效果:http://jquery.com/demo/thickbox/
您可能感興趣的文章:
- jQuery+CSS3+Html5實(shí)現(xiàn)彈出層效果實(shí)例代碼(附源碼下載)
- Jquery+CSS3實(shí)現(xiàn)一款簡(jiǎn)潔大氣帶滑動(dòng)效果的彈出層
- jQuery Dialog 彈出層對(duì)話框插件
- jQuery彈出層始終垂直居中相對(duì)于屏幕或當(dāng)前窗口
- jquery實(shí)現(xiàn)居中彈出層代碼
- JQuery彈出層示例可自定義
- jQuery+html5實(shí)現(xiàn)div彈出層并遮罩背景
- jQuery插件zoom實(shí)現(xiàn)圖片全屏放大彈出層特效
- jQuery Mobile彈出窗、彈出層知識(shí)匯總
- jQuery點(diǎn)縮略圖彈出層顯示大圖片
- jQuery Layer彈出層傳值到父頁(yè)面的實(shí)現(xiàn)代碼
- jquery+css3實(shí)現(xiàn)的經(jīng)典彈出層效果示例
相關(guān)文章
jquery 重寫 ajax提交并判斷權(quán)限后 使用load方法報(bào)錯(cuò)解決方法
這篇文章主要介紹了jquery 重寫 ajax提交并判斷權(quán)限后 使用load方法報(bào)錯(cuò)解決方法 的相關(guān)資料,需要的朋友可以參考下2016-01-01
jQuery實(shí)現(xiàn)選中彈出窗口選擇框內(nèi)容后賦值給文本框的方法
這篇文章主要介紹了jQuery實(shí)現(xiàn)選中彈出窗口選擇框內(nèi)容后賦值給文本框的方法,涉及jQuery響應(yīng)鼠標(biāo)事件動(dòng)態(tài)操作頁(yè)面元素屬性的相關(guān)技巧,需要的朋友可以參考下2015-11-11
關(guān)于HTML5的data-*自定義屬性的總結(jié)
大家總是習(xí)慣使用HTML標(biāo)簽添加自定義屬性來(lái)存儲(chǔ)和操作數(shù)據(jù),所以才在HTML5規(guī)范里增加了一個(gè)自定義data屬性,這樣使用更便捷,一起跟隨小編過(guò)來(lái)看看吧2018-05-05
JQuery動(dòng)畫和停止動(dòng)畫實(shí)例代碼
實(shí)例中涉及到使用動(dòng)畫方法animate,動(dòng)畫停止方法Stop,其他詳情在示例代碼中都有注釋。2013-03-03
jQuery實(shí)現(xiàn)的上拉刷新功能組件示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)的上拉刷新功能組件,涉及jQuery事件響應(yīng)與頁(yè)面元素屬性動(dòng)態(tài)操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2020-05-05
jquery綁定事件 bind和on的用法與區(qū)別分析
這篇文章主要介紹了jquery綁定事件 bind和on的用法與區(qū)別,結(jié)合實(shí)例形式分析了jquery綁定事件 bind和on的基本功能、用法、區(qū)別與操作注意事項(xiàng),需要的朋友可以參考下2020-05-05
基于jquery實(shí)現(xiàn)的自動(dòng)補(bǔ)全功能
這篇文章主要介紹了基于jquery實(shí)現(xiàn)的自動(dòng)補(bǔ)全功能的方法,涉及jQuery操作數(shù)據(jù)實(shí)現(xiàn)補(bǔ)全的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03

