<?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>trickeries! &#187; example</title>
	<atom:link href="http://trickeries.com/tag/example/feed/" rel="self" type="application/rss+xml" />
	<link>http://trickeries.com</link>
	<description>it's tricky to rock a style thats liked online</description>
	<lastBuildDate>Tue, 02 Mar 2010 06:01:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Javascript measurements, window.onload, and getimagesize</title>
		<link>http://trickeries.com/132/javascript-measurements-windowonload-and-getimagesize/</link>
		<comments>http://trickeries.com/132/javascript-measurements-windowonload-and-getimagesize/#comments</comments>
		<pubDate>Wed, 28 May 2008 08:58:09 +0000</pubDate>
		<dc:creator>atom</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[quick]]></category>
		<category><![CDATA[trickeries]]></category>

		<guid isPermaLink="false">http://trickeries.com/?p=132</guid>
		<description><![CDATA[If you use a lot of javascript for animations / measurements (like I do), it can be very useful to include the width and the height of any images you use in your &#60;img/&#62; tags.  This will make sure that width / height measurements taken by your javascript are accurate before waiting for all [...]]]></description>
			<content:encoded><![CDATA[<p>If you use a lot of javascript for animations / measurements (like I do), it can be very useful to include the width and the height of any images you use in your &lt;img/&gt; tags.  This will make sure that width / height measurements taken by your javascript are accurate before waiting for all of the images to load.  This leaves you free to run your code as soon as the dom is ready, without worrying about remeasuring once window.onload fires.</p>
<p>A teensy bit of php will take care of this for you if you do not already know the image size, or don&#8217;t care to look into it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;img alt=&quot;i am lazy&quot; src=&quot;/images/myImage.jpg&quot; <span style="color: #FF00FF; font-weight: bold;">&lt;?php</span> <span style="color: #0066FF;">list</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$w</span><span style="color: #339933;">,</span><span style="color: #00FF00;">$h</span><span style="color: #FF6600;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0066FF;">getimagesize</span><span style="color: #FF6600;">&#40;</span><span style="color: #00FF00;">$path_to_image</span><span style="color: #FF6600;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #00FF00;">echo</span> <span style="color: #FF0000;">&quot;width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$w</span><span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$h</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://trickeries.com/132/javascript-measurements-windowonload-and-getimagesize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
