<?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>[schuchlenz.com] &#187; fold</title>
	<atom:link href="http://www.schuchlenz.com/tag/fold/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.schuchlenz.com</link>
	<description>posts.each do { &#124;p&#124; read(p) }</description>
	<lastBuildDate>Thu, 25 Feb 2010 13:25:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using jQuery for every day tasks</title>
		<link>http://www.schuchlenz.com/using-jquery-for-every-day-tasks/</link>
		<comments>http://www.schuchlenz.com/using-jquery-for-every-day-tasks/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 08:28:33 +0000</pubDate>
		<dc:creator>Stefan Schuchlenz</dc:creator>
				<category><![CDATA[Tech Stuff]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[fold]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[slideToggle()]]></category>
		<category><![CDATA[toggle()]]></category>

		<guid isPermaLink="false">http://localhost/blog_schuchlenz/?p=3</guid>
		<description><![CDATA[A colleague asked me how to create a small folding box in javascript the other day. With JS alone, this task is really tedious so I gave him a quick heads up on how to accomplish that in a mere second with jQuery.
Let&#8217;s say we have a DIV in our HTML that has the id [...]]]></description>
			<content:encoded><![CDATA[<p>A colleague asked me how to create a small folding box in javascript the other day. With JS alone, this task is really tedious so I gave him a quick heads up on how to accomplish that in a mere second with <a href="http://www.schuchlenz.com/tag/jquery/" class="st_tag internal_tag" rel="tag" title="Posts tagged with jquery">jQuery</a>.</p>
<p>Let&#8217;s say we have a <a href="http://www.schuchlenz.com/tag/div/" class="st_tag internal_tag" rel="tag" title="Posts tagged with div">DIV</a> in our HTML that has the id &#8220;box&#8221; and we want to place a link beneath it, that opens and closes it, depending on the state it is in (open, closed).</p>
<p>Here&#8217;s the code:</p>
<p><code>&lt;<a href="http://www.schuchlenz.com/tag/div/" class="st_tag internal_tag" rel="tag" title="Posts tagged with div">div</a> id="box"&gt;i am a box&lt;/<a href="http://www.schuchlenz.com/tag/div/" class="st_tag internal_tag" rel="tag" title="Posts tagged with div">div</a>&gt;</code></p>
<p><code>&lt;a href="#" onclick="<a href="http://www.schuchlenz.com/tag/jquery/" class="st_tag internal_tag" rel="tag" title="Posts tagged with jquery">jQuery</a>('#box').toggle();"&gt;open/close&lt;/a&gt;</code></p>
<p>Now isn&#8217;t that neat? But what if we want to do that with style? Let&#8217;s slide the box when you click the link:</p>
<p><code>&lt;<a href="http://www.schuchlenz.com/tag/div/" class="st_tag internal_tag" rel="tag" title="Posts tagged with div">div</a> id="box"&gt;i am a box&lt;/<a href="http://www.schuchlenz.com/tag/div/" class="st_tag internal_tag" rel="tag" title="Posts tagged with div">div</a>&gt;</code></p>
<p><code>&lt;a href="#" onclick="<a href="http://www.schuchlenz.com/tag/jquery/" class="st_tag internal_tag" rel="tag" title="Posts tagged with jquery">jQuery</a>('#box').slideToggle();"&gt;open/close&lt;/a&gt;</code></p>
<p>Now the box slides up and down when you click the activator link &#8211; you can of course add the onclick() handler to another element or even to the box itself (although you then will need a separate link to reopen it)</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share this on:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F&amp;partner=sociable" title="Print"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F&amp;title=Using%20jQuery%20for%20every%20day%20tasks&amp;bodytext=A%20colleague%20asked%20me%20how%20to%20create%20a%20small%20folding%20box%20in%20javascript%20the%20other%20day.%20With%20JS%20alone%2C%20this%20task%20is%20really%20tedious%20so%20I%20gave%20him%20a%20quick%20heads%20up%20on%20how%20to%20accomplish%20that%20in%20a%20mere%20second%20with%20jQuery.%0D%0A%0D%0ALet%27s%20say%20we%20have%20a%20DIV%20in%20our%20HT" title="Digg"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F&amp;title=Using%20jQuery%20for%20every%20day%20tasks&amp;notes=A%20colleague%20asked%20me%20how%20to%20create%20a%20small%20folding%20box%20in%20javascript%20the%20other%20day.%20With%20JS%20alone%2C%20this%20task%20is%20really%20tedious%20so%20I%20gave%20him%20a%20quick%20heads%20up%20on%20how%20to%20accomplish%20that%20in%20a%20mere%20second%20with%20jQuery.%0D%0A%0D%0ALet%27s%20say%20we%20have%20a%20DIV%20in%20our%20HT" title="del.icio.us"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F&amp;t=Using%20jQuery%20for%20every%20day%20tasks" title="Facebook"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F&amp;title=Using%20jQuery%20for%20every%20day%20tasks&amp;annotation=A%20colleague%20asked%20me%20how%20to%20create%20a%20small%20folding%20box%20in%20javascript%20the%20other%20day.%20With%20JS%20alone%2C%20this%20task%20is%20really%20tedious%20so%20I%20gave%20him%20a%20quick%20heads%20up%20on%20how%20to%20accomplish%20that%20in%20a%20mere%20second%20with%20jQuery.%0D%0A%0D%0ALet%27s%20say%20we%20have%20a%20DIV%20in%20our%20HT" title="Google Bookmarks"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="javascript:AddToFavorites();" title="Add to favorites"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/addtofavorites.png" title="Add to favorites" alt="Add to favorites" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Using%20jQuery%20for%20every%20day%20tasks&amp;body=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F" title="email"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F&amp;bm_description=Using%20jQuery%20for%20every%20day%20tasks&amp;plugin=soc" title="MisterWong"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F&amp;t=Using%20jQuery%20for%20every%20day%20tasks" title="MySpace"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F&amp;title=Using%20jQuery%20for%20every%20day%20tasks" title="Reddit"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.schuchlenz.com/feed/" title="RSS"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fwww.schuchlenz.com%2Fusing-jquery-for-every-day-tasks%2F&amp;t=Using%20jQuery%20for%20every%20day%20tasks&opener=bm&amp;ei=UTF-8&amp;d=A%20colleague%20asked%20me%20how%20to%20create%20a%20small%20folding%20box%20in%20javascript%20the%20other%20day.%20With%20JS%20alone%2C%20this%20task%20is%20really%20tedious%20so%20I%20gave%20him%20a%20quick%20heads%20up%20on%20how%20to%20accomplish%20that%20in%20a%20mere%20second%20with%20jQuery.%0D%0A%0D%0ALet%27s%20say%20we%20have%20a%20DIV%20in%20our%20HT" title="Yahoo! Bookmarks"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.schuchlenz.com/javascript-cookies/" title="JavaScript cookies (30.10.2009)">JavaScript cookies</a> (0)</li>
	<li><a href="http://www.schuchlenz.com/irc-server-channels-added/" title="IRC server &#038; channels added! (19.11.2009)">IRC server &#038; channels added!</a> (0)</li>
	<li><a href="http://www.schuchlenz.com/how-to-process-multiple-checkboxes-with-jquery/" title="How to process multiple checkboxes with jQuery (09.11.2009)">How to process multiple checkboxes with jQuery</a> (0)</li>
	<li><a href="http://www.schuchlenz.com/how-to-ajax-with-jquery/" title="How to AJAX with jQuery (30.10.2009)">How to AJAX with jQuery</a> (0)</li>
	<li><a href="http://www.schuchlenz.com/changing-selected-option-in-a-select/" title="Changing selected option in a SELECT (04.11.2009)">Changing selected option in a SELECT</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.schuchlenz.com/using-jquery-for-every-day-tasks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
