jQuery內(nèi)容折疊效果插件用法實(shí)例分析(附demo源碼)
本文實(shí)例講述了jQuery內(nèi)容折疊效果插件用法。分享給大家供大家參考,具體如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>jQuery Collapsible Fieldset</title> <script src="js/jquery.min.js"></script> <script language="javascript" type="text/javascript" src="js/jquery.coolfieldset.js"></script> <link rel="stylesheet" type="text/css" href="css/jquery.coolfieldset.css" /> </head> <body> <h1>jQuery Collapsible Fieldset</h1> <br/> <fieldset id="fieldset1" class="coolfieldset"> <legend>Default</legend> <div> <p>By default the <b>fieldset</b> is opened or expanded at start. Click on its <b>legend</b> to close or collapse it.</p> <p>The code is simply like below</p> <pre> $('#fieldset1').coolfieldset(); </pre> </div> </fieldset> <br/> <fieldset id="fieldset2" class="coolfieldset"> <legend>Closed at start</legend> <div> <p>If we want the fieldset to be closed or collapsed at start, just add <b>{collapsed:true}</b> as the argument.</p> <pre> $('#fieldset2').coolfieldset({collapsed:true}); </pre> </div> </fieldset> <br/> <fieldset id="fieldset4" class="coolfieldset"> <legend>Animation Speed</legend> <div> <p>You can also define the animation speed for the fieldset while collapsing or expanding by using <b>speed</b> option. Acceptable values are "<b>fast</b>", "<b>medium</b>", "<b>slow</b>", or a number in millisecond.</p> <pre> $('#fieldset3').coolfieldset({speed:"fast"}); </pre> </div> </fieldset> <br/> <fieldset id="fieldset5" class="coolfieldset"> <legend>No Animation</legend> <div> <p>If you don't want to use animation effect, please use <b>animation</b> option and fill its value with <b>false</b>.</p> <pre> $('#fieldset4').coolfieldset({animation:false}); </pre> </div> </fieldset> <br/><br/> <fieldset id="fieldset3" class="coolfieldset"> <legend>Notes :</legend> <div> <ul> <li>All content inside fieldset (except the <b>legend</b> tag) should be placed inside the <b>div</b> tag.</li> <li>Edit the <b>jquery.coolfieldset.css</b> to change the fieldset style.</li> </ul> </div> </fieldset> <script> $('#fieldset1, #fieldset3').coolfieldset(); $('#fieldset2').coolfieldset({collapsed:true}); $('#fieldset4').coolfieldset({speed:"fast"}); $('#fieldset5').coolfieldset({animation:false}); </script> </body> </html>
完整實(shí)例代碼點(diǎn)擊此處本站下載。
更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery切換特效與技巧總結(jié)》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常見經(jīng)典特效匯總》、《jQuery動(dòng)畫與特效用法總結(jié)》、《jquery選擇器用法總結(jié)》及《jQuery常用插件及用法總結(jié)》
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
相關(guān)文章
jQuery學(xué)習(xí)筆記之控制頁面實(shí)現(xiàn)代碼
每一段jQuery對(duì)應(yīng)一段html代碼,以標(biāo)記為準(zhǔn)則,css為共用代碼,每段代碼需獨(dú)立運(yùn)行。html和css代碼在文章尾部,如下例2012-02-02jquery實(shí)現(xiàn)動(dòng)畫菜單的左右滾動(dòng)、漸變及圖形背景滾動(dòng)等效果
這篇文章主要介紹了jquery實(shí)現(xiàn)動(dòng)畫菜單的左右滾動(dòng)、漸變及圖形背景滾動(dòng)等效果,實(shí)例分析了jquery常用的幾種背景動(dòng)態(tài)變換效果,涉及jquery動(dòng)態(tài)操作頁面動(dòng)畫效果實(shí)現(xiàn)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-08-08基于jquery實(shí)現(xiàn)的鼠標(biāo)滑過按鈕改變背景圖片
基于jquery實(shí)現(xiàn)的鼠標(biāo)滑過按鈕改變背景圖片,發(fā)現(xiàn)用CSS用時(shí)IE6不兼容,所以就用見JQ實(shí)現(xiàn)。2011-07-07jQuery實(shí)現(xiàn)動(dòng)態(tài)生成年月日級(jí)聯(lián)下拉列表示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)動(dòng)態(tài)生成年月日級(jí)聯(lián)下拉列表,結(jié)合具體實(shí)例形式分析了jQuery日期時(shí)間運(yùn)算構(gòu)造級(jí)聯(lián)下拉列表相關(guān)操作技巧,需要的朋友可以參考下2019-05-05jQuery div層的放大與縮小簡單實(shí)現(xiàn)代碼
div層的放大與縮小想必大家已不是那么陌生了吧,接下來為大家詳細(xì)介紹下使用jQuery實(shí)現(xiàn),感興趣的各位可以參考下哈,希望可以幫助到你2013-03-03bootstrap中日歷范圍選擇插件daterangepicker的使用詳解
daterangepicker是bootstrap的一個(gè)日歷插件 主要用來選擇時(shí)間段的插件 這個(gè)插件很好用也很容易操作 。這篇文章主要介紹了bootstrap中日歷范圍選擇插件daterangepicker的使用詳解,需要的朋友可以參考下2018-04-04jQuery EasyUI API 中文幫助文檔和擴(kuò)展實(shí)例
這篇文章主要介紹了jQuery EasyUI API 中文幫助文檔和擴(kuò)展實(shí)例 的相關(guān)資料,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2016-08-08jQuery實(shí)現(xiàn)右鍵菜單、遮罩等效果代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)右鍵菜單、遮罩、彈出層效果,適應(yīng)管理系統(tǒng)界面,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-09-09