<?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; images</title>
	<atom:link href="http://wpwizard.net/tag/images/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>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>

