<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JJ Is Me &#187; plugin</title>
	<atom:link href="http://jjis.me/a/tag/plugin/feed" rel="self" type="application/rss+xml" />
	<link>http://jjis.me</link>
	<description>Me And My Code</description>
	<lastBuildDate>Sun, 29 Jan 2012 22:14:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jQuery Multi-Accordion</title>
		<link>http://jjis.me/a/719</link>
		<comments>http://jjis.me/a/719#comments</comments>
		<pubDate>Sat, 27 Aug 2011 05:15:00 +0000</pubDate>
		<dc:creator>jj_jiles</dc:creator>
				<category><![CDATA[jQuery & Javascript]]></category>
		<category><![CDATA[accordion]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://jjis.me/?p=719</guid>
		<description><![CDATA[I&#8217;ve developed my previous accordion a little further now. I&#8217;ve turned into a full plugin, plus it allows for multiple accordions on the same page. The way this differs, however, is that it allows you to create one accordion that closes open elements in another accordion and vice-versa. You may ask how this is different [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve developed my previous accordion a little further now. I&#8217;ve turned into a full plugin, plus it allows for multiple accordions on the same page. The way this differs, however, is that it allows you to create one accordion that closes open elements in another accordion and vice-versa. You may ask how this is different than a single accordion with tedious amounts of HTML and CSS. Well, the answer is simple: this is less work. By using jQuery&#8217;s traversing, I allow you to have more freedom in your HTML and CSS design, as well as fewer restraints on the hierarchical relationship between each accordion.</p>
<p>There is no CSS required for this plugin to work. The only CSS I recommend is setting the collapsible elements to &#8216;display: none&#8217;. This will keep the browser from rendering them initially causing that jittery appearance when the page first loads for the user.</p>
<p><span id="more-719"></span><br />
You can view the code below, with an example following:</p>
<h2>HTML:</h2>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&lt;div id=&quot;content-container&quot;&gt;
	&lt;!-- subsection of content container accordion 1 and 2 --&gt;
	&lt;div class=&quot;sub-content&quot;&gt;
		&lt;!-- Clickable headers (the actual anchor tags) that trigger the accordion --&gt;
		&lt;div class=&quot;accordion-headers&quot;&gt;
			&lt;a href=&quot;#&quot; class=&quot;clickable-header-accordion-1&quot;&gt;Click Me&lt;/a&gt;
			&lt;a href=&quot;#&quot; class=&quot;clickable-header-accordion-2&quot;&gt;Click Me&lt;/a&gt;
		&lt;/div&gt;
		&lt;!-- Accordion 1 header shows/hides this group --&gt;
		&lt;ul class=&quot;collapsible accordion1-collapsibles&quot;&gt;
			&lt;li&gt;First Accordion :: Item 1&lt;/li&gt;
			&lt;li&gt;First Accordion :: Item 2&lt;/li&gt;
			&lt;li&gt;First Accordion :: Item 3&lt;/li&gt;
			&lt;li&gt;First Accordion :: Item 4&lt;/li&gt;
		&lt;/ul&gt;
		&lt;!-- Accordion 2 header shows/hides this group --&gt;
		&lt;ul class=&quot;collapsible accordion2-collapsibles&quot;&gt;
			&lt;li&gt;Second Accordion :: Item 1&lt;/li&gt;
			&lt;li&gt;Second Accordion :: Item 2&lt;/li&gt;
			&lt;li&gt;Second Accordion :: Item 3&lt;/li&gt;
			&lt;li&gt;Second Accordion :: Item 4&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
	&lt;!-- // --&gt;

	&lt;!-- next subsection of content container accordion 1 and 2 --&gt;
	&lt;div class=&quot;sub-content&quot;&gt;
		&lt;!-- Clickable headers (the actual anchor tags) that trigger the accordion --&gt;
		&lt;div class=&quot;accordion-headers&quot;&gt;
			&lt;a href=&quot;#&quot; class=&quot;clickable-header-accordion-1&quot;&gt;Click Me&lt;/a&gt;
			&lt;a href=&quot;#&quot; class=&quot;clickable-header-accordion-2&quot;&gt;Click Me&lt;/a&gt;
		&lt;/div&gt;
		&lt;!-- Accordion 1 header shows/hides this group --&gt;
		&lt;ul class=&quot;collapsible accordion1-collapsibles&quot;&gt;
			&lt;li&gt;First Accordion :: Item 1&lt;/li&gt;
			&lt;li&gt;First Accordion :: Item 2&lt;/li&gt;
			&lt;li&gt;First Accordion :: Item 3&lt;/li&gt;
			&lt;li&gt;First Accordion :: Item 4&lt;/li&gt;
		&lt;/ul&gt;
		&lt;!-- Accordion 2 header shows/hides this group --&gt;
		&lt;ul class=&quot;collapsible accordion2-collapsibles&quot;&gt;
			&lt;li&gt;Second Accordion :: Item 1&lt;/li&gt;
			&lt;li&gt;Second Accordion :: Item 2&lt;/li&gt;
			&lt;li&gt;Second Accordion :: Item 3&lt;/li&gt;
			&lt;li&gt;Second Accordion :: Item 4&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
	&lt;!-- // --&gt;
&lt;/div&gt;
</pre>
<p>&nbsp;</p>
<p><strong>Again, please note: </strong>The CSS that is recommended is setting the collapsible elements to &#8216;disaply: none;&#8217;. Aside from that, there is no additional CSS required other than what is needed for your design.</p>
<p>&nbsp;</p>
<h2>jQuery and Javascript:</h2>
<pre class="brush: jscript; title: ; wrap-lines: false; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.multi-accordion.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
	var accordions = [
		{
			'parent'      : '.sub-content',                  // parent element containing the clickable header and collapsible
			'header'      : '.clickable-header-accordion-1', // clickable header
			'collapsible' : '.accordion1-collapsibles'        // collapsible element
		},
		{
			'parent'      : '.sub-content',                      // parent element containing the clickable header and collapsible
			'header'      : '.clickable-header-accordion-2',     // clickable header
			'collapsible' : '.accordion2-collapsibles',          // collapsible element
			'afterclose'  : function() { alert('after close'); },// callback that is fired onced the accordion is closed
			'afteropen'   : function() { alert('after open'); }  // callback that is fired after the accordion is opened
		}
	];
	$().accordion(accordions);
});
&lt;/script&gt;
</pre>
<p>&nbsp;</p>
<h2>Working Example:</h2>
<p>You can view a working example at <a href="http://jjis.me/jquery.multi-accordion.html">http://jjis.me/jquery.multi-accordion.html</a></p>
<p><a href="http://jjis.me/jquery.multi-accordion.js">Download the jQuery Multi-Accordion plugin</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://jjis.me/a/719/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery Tabs With Ease</title>
		<link>http://jjis.me/a/280</link>
		<comments>http://jjis.me/a/280#comments</comments>
		<pubDate>Sat, 03 Jul 2010 01:50:19 +0000</pubDate>
		<dc:creator>jj_jiles</dc:creator>
				<category><![CDATA[jQuery & Javascript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://jjis.me/?p=280</guid>
		<description><![CDATA[As usual, I always need something special in jQuery. I&#8217;m always able to find plugins out there, but they never everything I want, the way I want it done. Each always falls short somewhere. It either limits my design flexibility, is buggy or is just flat-out bloated with way more code than is necessary. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>As usual, I always need something special in jQuery. I&#8217;m always able to find plugins out there, but they never everything I want, the way I want it done. Each always falls short somewhere. It either limits my design flexibility, is buggy or is just flat-out bloated with way more code than is necessary.</p>
<p>I&#8217;ve written a tabs script for jQuery that is short and to the point while still allowing for design flexibility and ease. There&#8217;s nothing to it. Simply establish the tabs settings with your appropriate IDs and classes and you&#8217;re good to go. I&#8217;ve used on a few occasions and it has yet to fail me.</p>
<p>As usual, however, let me know if you have problems. I&#8217;ve supplied complete code for HTML, CSS and, of course, the jQuery/JavaScript.</p>
<p><span id="more-280"></span></p>
<h2></h2>
<h2>Let&#8217;s Start With The HTML</h2>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&lt;div id=&quot;tabs&quot;&gt;
	&lt;b class=&quot;active&quot;&gt;&lt;a href=&quot;#selected-categories&quot;&gt;Currently Selected Categories&lt;/a&gt;&lt;/b&gt;
	&lt;b class=&quot;inactive&quot;&gt;&lt;a href=&quot;#all-categories&quot;&gt;All Available Categories&lt;/a&gt;&lt;/b&gt;
&lt;/div&gt;

&lt;ul id=&quot;selected-categories&quot; class=&quot;tab&quot;&gt;
        &lt;li id=&quot;item1&quot; class=&quot;li-item&quot;&gt;Item 1 text&lt;/li&gt;
        &lt;li id=&quot;item2&quot; class=&quot;li-item&quot;&gt;Item 3 text&lt;/li&gt;
        &lt;li id=&quot;item3&quot; class=&quot;li-item&quot;&gt;Item 7 text&lt;/li&gt;
        &lt;li id=&quot;item3&quot; class=&quot;li-item&quot;&gt;Item 8 text&lt;/li&gt;
&lt;/ul&gt;
&lt;ul id=&quot;all-categories&quot; class=&quot;tab&quot;&gt;
        &lt;li id=&quot;item1&quot; class=&quot;li-item&quot;&gt;Item 1 text&lt;/li&gt;
        &lt;li id=&quot;item2&quot; class=&quot;li-item&quot;&gt;Item 2 text&lt;/li&gt;
        &lt;li id=&quot;item3&quot; class=&quot;li-item&quot;&gt;Item 3 text&lt;/li&gt;
        &lt;li id=&quot;item3&quot; class=&quot;li-item&quot;&gt;Item 4 text&lt;/li&gt;
        &lt;li id=&quot;item1&quot; class=&quot;li-item&quot;&gt;Item 5 text&lt;/li&gt;
        &lt;li id=&quot;item2&quot; class=&quot;li-item&quot;&gt;Item 6 text&lt;/li&gt;
        &lt;li id=&quot;item3&quot; class=&quot;li-item&quot;&gt;Item 7 text&lt;/li&gt;
        &lt;li id=&quot;item3&quot; class=&quot;li-item&quot;&gt;Item 8 text&lt;/li&gt;
&lt;/ul&gt;
</pre>
<h2>The CSS</h2>
<pre class="brush: css; title: ; wrap-lines: false; notranslate">
/* *****
* tab header properties
***** */
#tabs { margin: 0 0 -2px 0; height: 45px; }
	#tabs b { display: block; float: left; margin: 0px; background: #fff; font-weight: normal; }
	#tabs b.active { background: #e0d3e3; }
		#tabs b a { display: block; color: #a989b0; padding: 10px; border: 1px solid #d3d3d3; text-decoration: none; }
		#tabs b a:hover { background: #f5edf6; }

		#tabs b.active a { color: #663366; }
		#tabs b.inactive a:hover { background: #f5edf6; }

/* *****
* tab content
***** */
.tab { clear: both; width: 100%; height: 250px; margin: 0; padding: 0; overflow: hidden; overflow-y: scroll; background: #fff; border: 1px solid #d3d3d3; }
	.tab li { font-weight: normal; padding: 10px; border-bottom: 1px dotted #d3d3d3; cursor: pointer; color: #663366; }
	.tab li:hover { background: #e0d3e3; }
</pre>
<h2></h2>
<h2>The jQuery Code</h2>
<pre class="brush: jscript; title: ; wrap-lines: false; notranslate">

/* *************************************************
*
* configuration: settings for class &amp; ids of tab
* elements
************************************************* */
var tabs = {
	default_tab    : 0,                    // the # of the tab that should be shown on page load
	// the tab itself
	tab : {
		wrapper   : '#tabs',          // parent that wraps around each tab header
		container : 'b',                // the container that wraps around the clickable tab text
		clickable : 'a',                 // the clickable tab text
		_class     : {
			active   : 'active',   // class for the active tab
			inactive : 'inactive' // class for all inactive tabs
		}
	},
	// the content for each tab
	content : {
		_class  : '.tab'                 // class of the content for the tabs
	},

	/* *************************************************
	*
	* bind tabbing events
	*
	************************************************* */
	init : function() {
		$( tabs.tab.wrapper + ' ' + tabs.tab.clickable ).click(function() {
			var id 	= $(this).attr('href');
			var par 	= $(this).parent();

			// hide all tab content
			$.each( $( tabs.content._class ), function(i) {
				$( this ).css( 'display','none' );
			});

			// display the tab content chosen
			$( id ).css('display','block');

			// show the tab as clicked
			$.each( $( tabs.tab.wrapper + ' ' + tabs.tab.container ), function() {
				$( this ).removeClass( tabs.tab._class.active );
				$( this ).addClass( tabs.tab._class.inactive );
			});

			par.removeClass( tabs.tab._class.inactive );
			par.addClass( tabs.tab._class.active );

			return false;
		});

		// hide all tab content except the first tab
		$.each( $( tabs.content._class ), function(i) {
			if (i &gt; tabs.default_tab) {
				$( this ).css('display','none');
			}
		});
	}

};
</pre>
<h2></h2>
<h2>Now Initiate the Code</h2>
<pre class="brush: jscript; title: ; wrap-lines: false; notranslate">
$(document).ready(function() {
        /* ************************************
        * only initiate the tab function if tabs are preset */
	        if ( $('#tabs').length &gt; 0 ) {
		        tabs.init();
	        }
});
</pre>
<p>There you go. That&#8217;s all there is to it. The code is definitely portable and you could make it a plugin yourself if you wanted. I will get it setup to allow multiple sets of tabs per page and update when it&#8217;s completed.</p>
<h2>Example</h2>
<div id="tabs"><b class="active"><a href="#tab-a">Tab A</a></b><b class="inactive"><a href="#tab-b">Tab B</a></b></div>
<ul id="tab-a" class="tab">
<li id="item1" class="li-item">Item 1 text</li>
<li id="item3" class="li-item">Item 3 text</li>
<li id="item7" class="li-item">Item 7 text</li>
<li id="item8" class="li-item">Item 8 text</li>
</ul>
<ul id="tab-b" class="tab">
<li id="item2" class="li-item">Item 2 text</li>
<li id="item4" class="li-item">Item 4 text</li>
<li id="item5" class="li-item">Item 5 text</li>
<li id="item6" class="li-item">Item 6 text</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jjis.me/a/280/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Accordian without plug-ins &amp; with a bit of design freedom</title>
		<link>http://jjis.me/a/209</link>
		<comments>http://jjis.me/a/209#comments</comments>
		<pubDate>Sun, 13 Jun 2010 14:47:40 +0000</pubDate>
		<dc:creator>jj_jiles</dc:creator>
				<category><![CDATA[jQuery & Javascript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://jjis.me/?p=209</guid>
		<description><![CDATA[So you have a design and you have decided you want to use a jQuery accordion. You start to layout your design and implement the accordion only to find out that your design is going to cause problems with the standard accordion plug-ins. The problem with the standard accordion is that they require the child [...]]]></description>
			<content:encoded><![CDATA[<p>So you have a design and you have decided you want to use a jQuery accordion. You start to layout your design and implement the accordion only to find out that your design is going to cause problems with the standard accordion plug-ins.</p>
<p>The problem with the standard accordion is that they require the child and header elements to be nested within a parent.</p>
<p><span id="more-209"></span></p>
<h2>Example:</h2>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&lt;div id=&quot;accordion-wrapper&quot;&gt;
     &lt;h1&gt;Clickable Header 1&lt;/h1&gt;
          &lt;p&gt;Collapsible child 1&lt;/p&gt;
     &lt;h1&gt;Clickable Header 2&lt;/h1&gt;
          &lt;p&gt;Collapsible child 2&lt;/p&gt;
     &lt;h1&gt;Clickable Header 3&lt;/h1&gt;
          &lt;p&gt;Collapsible child 3&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>Where this limits us in our design is when we want to add some extra style to the accordion list. I tend to use lists when building a list. So, if we take the code above and wrap each header and collapsible child with an &lt;li&gt;, we would completely break the accordion.</p>
<h2>Let&#8217;s break it down</h2>
<p>The standard jQuery accordion would prohibit this because the layout would throw off the jQuery plugin. The plugins look at the wrapping element (in this case &#8220;accordion-wrapper&#8221;). It then finds all header (&lt;h1&gt;) elements and binds the click event. This click event finds the first occurrence of the collapsible element (&lt;p&gt;) and will either expand or collapse it depending on it&#8217;s current state.</p>
<h2>Let&#8217;s fix this</h2>
<p>With the following script, you simply specify what the header class is going to be and what the collapsible class is going to be. What this allows us to do is place our accordion headers and collapsible elements within structured list, thus allowing more design/layout freedom.</p>
<h2>Example:</h2>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&lt;ul id=&quot;accordion-list&quot;&gt;
	&lt;li class=&quot;accordion-item&quot;&gt;
		&lt;h1 class=&quot;accordion-header&quot;&gt;Clickable Header 1&lt;/h1&gt;
		&lt;p&gt;Just placed here for an example of how we don't have our header and collapsible elements stacked&lt;/p&gt;
			&lt;ul class=&quot;accordion-collapsible&quot;&gt;
				&lt;li&gt;Collapsible child 1&lt;/li&gt;
				&lt;li&gt;Collapsible child 2&lt;/li&gt;
				&lt;li&gt;Collapsible child 3&lt;/li&gt;
				&lt;li&gt;Collapsible child 4&lt;/li&gt;
			&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li class=&quot;accordion-item&quot;&gt;
		&lt;h1 class=&quot;accordion-header&quot;&gt;Clickable Header 2&lt;/h1&gt;
		&lt;p&gt;Just placed here for an example of how we don't have our header and collapsible elements stacked&lt;/p&gt;
			&lt;ul class=&quot;accordion-collapsible&quot;&gt;
				&lt;li&gt;Collapsible child 1&lt;/li&gt;
				&lt;li&gt;Collapsible child 2&lt;/li&gt;
				&lt;li&gt;Collapsible child 3&lt;/li&gt;
				&lt;li&gt;Collapsible child 4&lt;/li&gt;
			&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li class=&quot;accordion-item&quot;&gt;
		&lt;h1 class=&quot;accordion-header&quot;&gt;Clickable Header 3&lt;/h1&gt;
		&lt;p&gt;Just placed here for an example of how we don't have our header and collapsible elements stacked&lt;/p&gt;
			&lt;ul class=&quot;accordion-collapsible&quot;&gt;
				&lt;li&gt;Collapsible child 1&lt;/li&gt;
				&lt;li&gt;Collapsible child 2&lt;/li&gt;
				&lt;li&gt;Collapsible child 3&lt;/li&gt;
				&lt;li&gt;Collapsible child 4&lt;/li&gt;
			&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>&nbsp;</p>
<h2>The jQuery Code:</h2>
<pre class="brush: jscript; title: ; wrap-lines: false; notranslate">
$(document).ready(function() {
	/* ***
	* REQUIRED
	* set you classes accordingly below. */
	var accordion = {
		parent      : '.accordion-item',        // parent element containing the clickable header and collapsible
		header      : '.accordion-header',      // clickable header
		collapsible : '.accordion-collapsible'  // collapsible element
	};

	/* ***
	* hide all collapsible items */
	$(accordion.collapsible).css('display','none');

	/* ****
	* bind the accordion header click event */
	$(accordion.header).unbind('click');
	$(accordion.header).bind('click', function() {
		var header_obj      = $(this);          // The current header
		var next_parent_obj = $(this).parent(); // The parent of the header

		var content_obj = $(this).siblings(accordion.collapsible); // find the collapsible element

		if(content_obj.is(&quot;:hidden&quot;)) {
			// collapse all collapsible elements
			next_parent_obj.siblings(accordion.parent).each(function() {
				$(this).children(accordion.collapsible).slideUp('fast');
			});
			// show the content of the clicked header
			content_obj.slideDown('fast');
		} else {
			content_obj.slideUp('fast');
		}
	});
});
</pre>
<p>&nbsp;</p>
<h2>Seeing it in action</h2>
<p><span><br /></span></p>
<ul id="accordion-list">
<li class="accordion-item">
<h1 class="accordion-header">Clickable Header 1</h1>
<p>Just placed here for an example of how we don&#8217;t have our header and collapsible elements stacked</p>
<ul class="accordion-collapsible">
<li>Collapsible child 1</li>
<li>Collapsible child 2</li>
<li>Collapsible child 3</li>
<li>Collapsible child 4</li>
</ul>
</li>
<li class="accordion-item">
<h1 class="accordion-header">Clickable Header 2</h1>
<p>Just placed here for an example of how we don&#8217;t have our header and collapsible elements stacked</p>
<ul class="accordion-collapsible">
<li>Collapsible child 1</li>
<li>Collapsible child 2</li>
<li>Collapsible child 3</li>
<li>Collapsible child 4</li>
</ul>
</li>
<li class="accordion-item">
<h1 class="accordion-header">Clickable Header 3</h1>
<p>Just placed here for an example of how we don&#8217;t have our header and collapsible elements stacked</p>
<ul class="accordion-collapsible">
<li>Collapsible child 1</li>
<li>Collapsible child 2</li>
<li>Collapsible child 3</li>
<li>Collapsible child 4</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://jjis.me/a/209/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery “characters remaining” script</title>
		<link>http://jjis.me/a/89</link>
		<comments>http://jjis.me/a/89#comments</comments>
		<pubDate>Tue, 30 Mar 2010 18:44:42 +0000</pubDate>
		<dc:creator>jj_jiles</dc:creator>
				<category><![CDATA[jQuery & Javascript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://jjis.me/?p=89</guid>
		<description><![CDATA[This is a jQuery script for displaying &#8220;characters remaining&#8221; for input fields. It will look for any input element with the class &#8220;input&#8221; (or whatever you specify) and use the element&#8217;s maxlength attribute as the value to count against and update the &#8220;fieldName-counter&#8221; element. This is a very useful script for those occasions when you [...]]]></description>
			<content:encoded><![CDATA[<p>This is a jQuery script for displaying &#8220;characters remaining&#8221; for input fields.</p>
<p>It will look for any input element with the class &#8220;input&#8221; (or whatever you specify) and use the element&#8217;s maxlength attribute as the value to count against and update the &#8220;fieldName-counter&#8221; element.</p>
<p>This is a very useful script for those occasions when you want to limit the character entry for an input field.</p>
<p><span id="more-89"></span></p>
<pre class="brush: jscript; html-script: true; title: ; wrap-lines: false; notranslate">
&lt;!-- input and character count element --&gt;
    &lt;span id=&quot;fieldName-counter&quot;&gt;100&lt;/span&gt; characters remaining&lt;br /&gt;
    &lt;input type=&quot;text&quot; name=&quot;fieldName&quot; id=&quot;fieldName&quot; maxlength=&quot;100&quot; class=&quot;input&quot; /&gt;
&lt;!--/elements--&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
    // change .input to desired class
    $('.input').each(function() {
        var inp = $(this);
        var maxlen =inp.attr('maxlength');
        if (maxlen &amp;gt; 0) {
            inp.bind('keyup', function(e) {
                len = new Number(inp.val().length);
                counter = maxlen-len;
                counterObj = '#' + inp.attr('id') + '-counter';
                $(counterObj).text(counter);
            });
        }
    });
});
&lt;/script&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jjis.me/a/89/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 1/27 queries in 0.178 seconds using disk: basic
Object Caching 365/432 objects using disk: basic

Served from: jjis.me @ 2012-02-06 11:23:32 -->
