首页 > PHP资讯 > HTML5培训技术 > jQuery内容折叠效果插件用法实例分析(附demo源码)_jquery

jQuery内容折叠效果插件用法实例分析(附demo源码)_jquery

HTML5培训技术
本文实例讲述了jQuery内容折叠效果插件用法。分享给大家供大家参考,具体如下:

  jQuery Collapsible Fieldset  <script src="js/jquery.min.js?1.1.9">《script》  <script language="javascript" type="text/javascript" src="js/jquery.coolfieldset.js?1.1.9">《script》    

jQuery Collapsible Fieldset


Default

By default the fieldset is opened or expanded at start. Click on its legend to close or collapse it.

The code is simply like below

$('#fieldset1').coolfieldset();


Closed at start

If we want the fieldset to be closed or collapsed at start, just add {collapsed:true} as the argument.

$('#fieldset2').coolfieldset({collapsed:true});


Animation Speed

You can also define the animation speed for the fieldset while collapsing or expanding by using speed option. Acceptable values are "fast", "medium", "slow", or a number in millisecond.

$('#fieldset3').coolfieldset({speed:"fast"});


No Animation

If you don't want to use animation effect, please use animation option and fill its value with false.

$('#fieldset4').coolfieldset({animation:false});



Notes :

  • All content inside fieldset (except the legend tag) should be placed inside the p tag.
  • Edit the jquery.coolfieldset.css to change the fieldset style.

《script》 $('#fieldset1, #fieldset3').coolfieldset(); $('#fieldset2').coolfieldset({collapsed:true}); $('#fieldset4').coolfieldset({speed:"fast"}); $('#fieldset5').coolfieldset({animation:false}); 《script》

完整实例代码点击此处本站下载。

更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery切换特效与技巧总结》、《jQuery拖拽特效与技巧总结》、《jQuery扩展技巧总结》、《jQuery常见经典特效汇总》、《jQuery动画与特效用法总结》、《jquery选择器用法总结》及《jQuery常用插件及用法总结》

希望本文所述对大家jQuery程序设计有所帮助。

HTML5培训技术

本文由欣才IT学院整理发布,未经许可,禁止转载。
支持4不支持0