<?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>TecReviews.net &#187; jQuery</title>
	<atom:link href="http://tecreviews.net/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://tecreviews.net</link>
	<description>Design - Code - Inspire</description>
	<lastBuildDate>Thu, 13 Aug 2009 15:16:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Add jQuery to WordPress</title>
		<link>http://tecreviews.net/javascript/add-jquery-to-wordpress/</link>
		<comments>http://tecreviews.net/javascript/add-jquery-to-wordpress/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 18:08:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://tecreviews.net/?p=81</guid>
		<description><![CDATA[jQuery is a very impressive way to add a touch of professionalism to your site and has really taken off with the advent of the Web 2.0 bandwagon. Here, I&#8217;ll show you how to add Collapsible Divs to your site AND to your wordpress blog. Have a look at the Collapsible jQuery Example for wordpress [...]]]></description>
			<content:encoded><![CDATA[<p>jQuery is a very impressive way to add a touch of professionalism to your site and has really taken off with the advent of the Web 2.0 bandwagon. Here, I&#8217;ll show you how to add Collapsible Divs to your site AND to your wordpress blog.</p>
<p>Have a look at the <strong>Collapsible jQuery Example</strong> for wordpress we are going to use here.</p>
<table style="height: 32px;" border="0" width="285">
<tbody>
<tr>
<td><img class="alignnone" title="link" src="/wp-content/uploads/2008/11/link_go.png" alt="" width="16" height="16" /></td>
<td><a id="click" href="#click">jQuery WordPress Example</a></td>
</tr>
</tbody>
</table>
<div class="box">
<div id="content1"><a href="http://tecreviews.net/wp-content/uploads/2008/11/jquery-pic.jpg"><img class="alignright size-medium wp-image-97" style="margin: 5px;" title="jquery-pic" src="http://tecreviews.net/wp-content/uploads/2008/11/jquery-pic.jpg" alt="" width="300" height="199" /></a>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam dictum diam in nisl. Nunc eu metus quis turpis elementum euismod. Maecenas ut est id nunc gravida volutpat. Fusce sit amet urna nec erat elementum viverra. Aliquam urna sem, accumsan in, vulputate at, egestas eu, felis.Ut risus.<br />
Aliquam non magna fringilla justo varius scelerisque. Nam consectetuer lectus et urna. Cras a ligula elementum quam vulputate fringilla. Vestibulum lorem. Nulla neque sem, dictum a, fermentum in, suscipit at, nunc. Vestibulum vitae tortor in risus facilisis iaculis.</p>
<p>Nulla elit nisl, tempus vitae, pulvinar eget, consectetuer eget, enim. Nam condimentum. Nullam euismod, magna non posuere tristique, magna lorem hendrerit risus, a scelerisque quam enim quis quam. Sed id enim. Aenean eget orci.</p>
<table style="height: 32px;" border="0" width="90">
<tbody>
<tr>
<td><img class="alignnone" title="link" src="/wp-content/uploads/2008/11/link_go.png" alt="" width="16" height="16" /></td>
<td><a id="close" href="#click">Close</a></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>So, how to add this magic to your blog?</p>
<p><span id="more-81"></span></p>
<p>First go to your <strong>theme editor</strong> and add the following code fragment to your &#8216;<strong>Header.php</strong>&#8216; file right after the <strong>&lt;?php wp_head(); ?&gt;</strong> tag:</p>
<p><script type="text/javascript"><!--
      jQuery(document).ready(function(){</p>
<p>	  jQuery('#content1').hide();</p>
<p>   			jQuery('a').click(function(){</p>
<p>			jQuery('#content1').show('slow');</p>
<p>   });</p>
<p>   jQuery('a#close').click(function(){
   		jQuery('#content1').hide('slow');
		})</p>
<p> 	  });
// --></script></p>
<pre id="preform"><code>&lt;?php wp_enqueue_script('jquery'); ?&gt;

&lt;script type="text/javascript"&gt;
      jQuery(document).ready(function(){
      jQuery('#content1').hide();
      jQuery('a').click(function(){
            jQuery('#content1').show('slow');
      });

   jQuery('a#close').click(function(){
           jQuery('#content1').hide('slow');
        })
       });
&lt;/script&gt;
</code></pre>
<p>The code above first waits for the page to <strong>load completely</strong> before initiating the jQuery calls. The calls to hide and show the content are then defined as well as the speed of the show/hide functions.</p>
<p>Now add the following html code to your<strong> wordpress blog</strong>. Make sure it is added in <strong>HTML </strong>mode:</p>
<pre id="preform">&lt;a id="click" href="#"&gt;Collapsible divs jQuery for WordPress&lt;/a&gt;
&lt;div class="box"&gt;
&lt;div id="content1"&gt;&lt;img class="alignright" src="http://www.telcojobs.eu/cms/Portals/0/Nokia_HQ.jpg" alt="" width="300" height="225" /&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean leo felis, tristique et, hendrerit sed, pharetra id, felis. Vestibulum rhoncus dictum tortor. Donec id enim. Nulla cursus ultrices elit. Suspendisse feugiat, magna vitae tincidunt condimentum, erat tortor cursus nibh, at congue arcu lectus quis nulla. Phasellus sed augue. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 

Etiam facilisis, enim nec gravida viverra, nisi lorem posuere arcu, nec interdum metus lorem vel risus. Donec est erat, viverra a, dapibus quis, interdum eu, dui.
&lt;a id="close" href="#"&gt;Close&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<p>This is the divs containing the content. Notice the <strong>id names</strong> given to the &lt;a&gt; and &lt;div&gt; tags as they correspond to the jQuery calls defined in the header.</p>
<p>Add the following stlye tags to your css code (usually style.css) to add a nice border to the content.</p>
<pre id="preform"><code>#content1{
    border:1px solid #CCCC33;
    padding:10px;
    margin-top:10px;
    width:500px;

}
</code></pre>
<p>Publish your page and click on the <a id="click" href="#">Collapsible divs jQuery for WordPress</a> link to test your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://tecreviews.net/javascript/add-jquery-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
