pax_global_header00006660000000000000000000000064123125463600014514gustar00rootroot0000000000000052 comment=2b9816d0bd0a7ad0a9a555bb341c1201313471b5 jquery-coolfieldset-1.0.1/000077500000000000000000000000001231254636000155045ustar00rootroot00000000000000jquery-coolfieldset-1.0.1/README.md000066400000000000000000000031231231254636000167620ustar00rootroot00000000000000# JQuery Plugin For Collapsible Fieldset * Copyright: © 2010 Lucky * License: [GPL](http://www.gnu.org/licenses/gpl.html) * Homepage: [w3shaman](http://w3shaman.com/article/jquery-plugin-collapsible-fieldset) If you need to create collapsible and expandable fieldset, this jQuery plugin might be helpful. This plugin can collapse or hide fieldset and its content by clicking its `legend`. You can also decide the initial state for your fieldset wheter it's expanded or collapsed. The separated CSS file will also be useful if you need to modify the fieldset appearance. By the way, this plugin is named **coolfieldset**. ## Using Coolfieldset Just like others jQuery plugin, this plugin is also easy to use. Just include jQuery and this plugins inside the <head> tag. And include the CSS file for styling the fieldset. Prepare your fieldset.
Legend

Fieldset content goes here.

And finally, use this script to turn your fieldsets into collapsible. ## Example The more complete example be seen [here](http://stuff.w3shaman.com/jquery- plugins/coolfieldset/). jquery-coolfieldset-1.0.1/changelog.md000066400000000000000000000004241231254636000177550ustar00rootroot00000000000000Coolfieldset changelog ---------------------- ## Version 1.0.1 * Removed CRLF from jquery-coolfieldset.js * Removed minified jquery from sources * Removed +x flag on jquery-coolfieldset.js * Added this changelog * Fix some typos ## Verion 1.0.0 * Initial release from Lucky jquery-coolfieldset-1.0.1/css/000077500000000000000000000000001231254636000162745ustar00rootroot00000000000000jquery-coolfieldset-1.0.1/css/jquery.coolfieldset.css000066400000000000000000000007131231254636000230010ustar00rootroot00000000000000.coolfieldset, .coolfieldset.expanded{ border:1px solid #aaa; } .coolfieldset.collapsed{ border:0; border-top:1px solid #aaa; } .coolfieldset legend{ padding-left:13px; font-weight:bold; cursor:pointer; } .coolfieldset legend, .coolfieldset.expanded legend{ background: transparent url(../images/expanded.gif) no-repeat center left; } .coolfieldset.collapsed legend{ background: transparent url(../images/collapsed.gif) no-repeat center left; }jquery-coolfieldset-1.0.1/images/000077500000000000000000000000001231254636000167515ustar00rootroot00000000000000jquery-coolfieldset-1.0.1/images/collapsed.gif000066400000000000000000000002601231254636000214040ustar00rootroot00000000000000GIF89a ɶ!, -%NbYBU11n%RU! {DcWfUC;jquery-coolfieldset-1.0.1/images/expanded.gif000066400000000000000000000002671231254636000212350ustar00rootroot00000000000000GIF89a ۹!, 4 %diJ@-O1S,ԐS2diF A Pb( p ;jquery-coolfieldset-1.0.1/index.html000066400000000000000000000044721231254636000175100ustar00rootroot00000000000000 jQuery Collapsible Fieldset

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 div tag.
  • Edit the jquery.coolfieldset.css to change the fieldset style.
jquery-coolfieldset-1.0.1/js/000077500000000000000000000000001231254636000161205ustar00rootroot00000000000000jquery-coolfieldset-1.0.1/js/jquery.coolfieldset.js000066400000000000000000000026721231254636000224570ustar00rootroot00000000000000/** * jQuery Plugin for creating collapsible fieldset * @requires jQuery 1.2 or later * * Copyright (c) 2010 Lucky * Licensed under the GPL license: * http://www.gnu.org/licenses/gpl.html * * "animation" and "speed" options are added by Mitch Kuppinger */ (function($) { function hideFieldsetContent(obj, options){ if(options.animation==true) obj.find('div').slideUp(options.speed); else obj.find('div').hide(); obj.removeClass("expanded"); obj.addClass("collapsed"); } function showFieldsetContent(obj, options){ if(options.animation==true) obj.find('div').slideDown(options.speed); else obj.find('div').show(); obj.removeClass("collapsed"); obj.addClass("expanded"); } $.fn.coolfieldset = function(options){ var setting={collapsed:false, animation:true, speed:'medium'}; $.extend(setting, options); this.each(function(){ var fieldset=$(this); var legend=fieldset.children('legend'); if(setting.collapsed==true){ legend.toggle( function(){ showFieldsetContent(fieldset, setting); }, function(){ hideFieldsetContent(fieldset, setting); } ) hideFieldsetContent(fieldset, {animation:false}); } else{ legend.toggle( function(){ hideFieldsetContent(fieldset, setting); }, function(){ showFieldsetContent(fieldset, setting); } ) } }); } })(jQuery);