<?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>WP Wizard &#187; jQuery</title>
	<atom:link href="http://wpwizard.net/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpwizard.net</link>
	<description>I ❤ WordPress</description>
	<lastBuildDate>Sat, 05 Mar 2011 12:30:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>jQuery: Boxes of Equal Height</title>
		<link>http://wpwizard.net/jquery/jquery-boxes-of-equal-height/</link>
		<comments>http://wpwizard.net/jquery/jquery-boxes-of-equal-height/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 07:40:15 +0000</pubDate>
		<dc:creator>Stian Andreassen</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://stianandreassen.com/?p=423</guid>
		<description><![CDATA[Use a small jQuery script and CSS to crate div-boxes of equal height.]]></description>
			<content:encoded><![CDATA[<p>Ever had parallel boxes on a website you&#8217;re developing, and wanted them to have the same height, but still wanting them to have dynamic height, i.e. not having to lock them to a certain height in the CSS? I certainly have, and it&#8217;s usually difficult. But jQuery provides a simple sollution!</p>
<p><span id="more-423"></span>Say this is our starting point:</p>
<p><img class="aligncenter size-full wp-image-424" title="jquerybox_fig1" src="http://wpwizard.net/wp-content/uploads/2010/04/jquerybox_fig1.png" alt="" width="500" height="300" /></p>
<p>Two boxes, with different content, and thus different height. These two can quite easilly be made to have the same height, with a bit of jQuery magic. We start out by identifying them, adding a unique ID for each box. In this example I&#8217;ve simply called them #box1 and #box 2:</p>
<p><img class="aligncenter size-full wp-image-425" title="jquerybox_fig2" src="http://wpwizard.net/wp-content/uploads/2010/04/jquerybox_fig2.png" alt="" width="500" height="300" /></p>
<p>Then I utilize the following script, which will measure both boxes, find the one that is highest, and then apply that height to the shorter one:</p>
<pre class="brush: jscript; title: ;">
&lt;script type=&quot;text/javascript&quot;&gt;
jQuery.noConflict();
jQuery(document).ready(function($){

	box1height = $('#box1').height();
	box2height = $('#box2').height();
	if(box1height&gt;box2height){
	$('#box2').css('height', box1height);
	}
	else {
	$('#box1').css('height', box2height);
	}
});
&lt;/script&gt;
</pre>
<p>The result will be this:</p>
<p><img class="aligncenter size-full wp-image-426" title="jquerybox_fig3" src="http://wpwizard.net/wp-content/uploads/2010/04/jquerybox_fig3.png" alt="" width="500" height="300" /></p>
<p>Easy as that!</p>
<div class="shr-publisher-423"></div>]]></content:encoded>
			<wfw:commentRss>http://wpwizard.net/jquery/jquery-boxes-of-equal-height/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add jQuery to your Theme or Plugin</title>
		<link>http://wpwizard.net/jquery/add-jquery-to-your-theme-or-plugin/</link>
		<comments>http://wpwizard.net/jquery/add-jquery-to-your-theme-or-plugin/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 13:41:53 +0000</pubDate>
		<dc:creator>Stian Andreassen</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://stianandreassen.com/?p=394</guid>
		<description><![CDATA[Add jQuery (and other script-libraries) to your Themes and Plugins in a clean way, that won't cause problems.]]></description>
			<content:encoded><![CDATA[<p>I often use <strong>jQuery</strong> in the <strong>Themes</strong> and, without exception, in all the <strong>Plugins</strong> I write. You can easilly add jQuery to any HTML-document by simply linking to Googles jQuery-script, but this is not always without problems, especially if your sites employs several libraries.<br />
<span id="more-394"></span></p>
<p>jQuery is often added with this line between  and <code>&lt;head&gt;</code> and <code>&lt;/head&gt;</code>:</p>
<pre class="brush: xml; auto-links: false; title: ;">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryjs.googlecode.com/files/jquery-1.3.2.js&quot;&lt;/script&gt;
</pre>
<p>But this can – among other things – cause latency in page loading, and is really not necessary as <strong>WordPress</strong> comes pre-packed with a lot of script-libraries, including jQuery.</p>
<p>To add jQuery (or Script-A-Licious or ProtoType) to your Theme, you simply use the <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">wp_enqueue_script()</a> function. In your Themes <code>functions.php</code> (if it doesn&#8217;t exists, simply create it) you add these lines:</p>
<pre class="brush: php; title: ;">
&lt;?php
function yourtheme_init(){
 wp_enqueue_script('jquery');
 wp_enqueue_script('jquery-ui-core');
}
add_filter('wp_enqueue_scripts', 'yourtheme_init');
?&gt;
</pre>
<p>This will load jQuery on your site’s frontend. If you have plugins that use jQuery, the upshot of this method is that WP will not load jQuery multiple times (as it will if you add it manually to your Theme), and thus not cause conflicts.</p>
<p>To avoid jQuery conflicts you should also surround your scripts with this:</p>
<pre class="brush: jscript; highlight: [5]; title: ;">
&lt;script type=&quot;text/javascript&quot;&gt;
jQuery.noConflict();
jQuery(document).ready(function($){

YOUR SCRIPT HERE

});
&lt;/script&gt;
</pre>
<div class="shr-publisher-394"></div>]]></content:encoded>
			<wfw:commentRss>http://wpwizard.net/jquery/add-jquery-to-your-theme-or-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove IMG height and width with jQuery</title>
		<link>http://wpwizard.net/jquery/remove-img-height-and-width-with-jquery/</link>
		<comments>http://wpwizard.net/jquery/remove-img-height-and-width-with-jquery/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 08:55:05 +0000</pubDate>
		<dc:creator>Stian Andreassen</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://stianandreassen.com/?p=304</guid>
		<description><![CDATA[Remove inline height and width, added by WordPress on images, with a simple jQuery-script.]]></description>
			<content:encoded><![CDATA[<p>WordPress automatically adds inline width and height when you insert images into your <strong>Pages</strong> or <strong>Posts</strong>. This can cause layout problems, especially in IE, if you use CSS to change the dimensions of your images. <span id="more-304"></span>For instance, <code>max-width: 100px; height: auto;</code> will not work in some browsers, because they resepect the inline height over the CSS.</p>
<p><strong>The sollutions is simple:</strong> Remove the width and height attributes with <strong>jQuery</strong>. The following code between <code>&lt;head&gt;</code> and <code>&lt;/head&gt;</code> will do the job:</p>
<pre class="brush: jscript; title: ;">
&lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
jQuery.noConflict();
jQuery(document).ready(function($){

	$('img').each(function(){
		$(this).removeAttr('width')
		$(this).removeAttr('height');
	});

});
&lt;/script&gt;
</pre>
<p>Note that this code will remove width and height on <em>all</em> images. You can use class or ID selectors if you just want to remove it on some, say in the sidebar: <code>$('#sidebar img').each(function(){ </code></p>
<div class="shr-publisher-304"></div>]]></content:encoded>
			<wfw:commentRss>http://wpwizard.net/jquery/remove-img-height-and-width-with-jquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

