<?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>ReDsgn &#187; jQuery</title>
	<atom:link href="http://www.redsgn.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.redsgn.com</link>
	<description>When small things come together great things happen.</description>
	<lastBuildDate>Tue, 10 Nov 2009 04:15:01 +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>jQuery plugin to add captions to images from image attributes</title>
		<link>http://www.redsgn.com/2009/01/17/jquery-plugin-to-add-captions-to-images-from-image-attributes/</link>
		<comments>http://www.redsgn.com/2009/01/17/jquery-plugin-to-add-captions-to-images-from-image-attributes/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 20:38:09 +0000</pubDate>
		<dc:creator>Paul Boutin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.redsgn.com/?p=168</guid>
		<description><![CDATA[I wrote a plugin for jQuery (a JavaScript library), to add a border and caption text to all images with a given class name. I&#8217;m a semantic junkie so, the code uses the all of the valid tag attributes in the &#8220;img&#8221; tag. alt = caption, border = border hspace = left and right margin, [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a plugin for jQuery (a JavaScript library), to add a border and caption text to all images with a given class name. I&#8217;m a semantic junkie so, the code uses the all of the valid tag attributes in the &#8220;img&#8221; tag. alt = caption, border = border hspace = left and right margin, vspace = top and bottom margin, align = float position either left or right defaulted to the left blank leaves it inline.</p>
<p>enough talk let&#8217;s see it.<br />
<img class="caption" src="http://www.redsgn.com/wp-content/uploads/2008/11/paul.jpg" border="1" alt="testing jQuery captions!" hspace="5" vspace="5" align="left" /> This sample uses all defaults of the script the attributes set are border = 1, alt = &#8220;testing jQuery captions!&#8221;, hspace = 5, vspace = 5, align = left.<br />
<span id="more-168"></span><br />
To override the defaults you can add in options into the function call. </p>
<p>Here is a list of all possible parameters.</p>
<ul style="list-style-position:inside;">
<li>bgcolor</li>
<li>fontcolor</li>
<li>font</li>
<li>fontsize</li>
<li>margin</li>
<li>align</li>
<li>width</li>
<li>border</li>
</ul>
<p>My Image tag looks like this.</p>
<p><code>&lt;img class="caption" src="http://www.redsgn.com/wp-content/uploads/2008/11/paul.jpg" border="1" alt="testing jQuery captions!" hspace="5" vspace="5" align="left" /&gt;<br />
</code></p>
<p>In order to rewrite the images tags I call the function on the ready state of the document so I place my call inside an onload block like this.</p>
<p><code>jQuery(document).ready(function(){<br />
});<br />
</code></p>
<p>Inside the ready block I make my call.</p>
<p><code>jQuery('img.caption').addcaption();<br />
</code></p>
<p>This will effect all images on the current document that have a class of &#8220;caption&#8221;.</p>
<p>My final load script block.</p>
<p><code>jQuery(document).ready(function(){<br />
    jQuery('img.caption').addcaption();<br />
});<br />
</code></p>
<p>The output of the script is semantic too.</p>
<p><code>&lt;span style="border: 1px solid #000000; margin: 5px; padding: 0px; background-color: #ffffff; display: block; float: left; text-align: center; width: 137px; cursor: pointer;"&gt;<br />
    &lt;img alt="testing jQuery captions!" src="http://www.redsgn.com/wp-content/uploads/2008/11/paul.jpg" class="caption" style="border: none ; margin: auto;"/&gt;<br />
    &lt;span style="padding: 2px; display: block; text-align: center; background-color: #ffffff; color: #333333; font-family: Arial,Helvetica,sans-serif; font-size: 10px; width: 133px;"&gt;testing jQuery captions!&lt;/span&gt;<br />
&lt;/span&gt;<br />
</code></p>
<h3>Download</h3>
<p><a class="download" href="http://www.redsgn.com/wp-includes/js/jquery/jquery.addcaption.js" title="jQuery image captions">Download jQuery image captions</a></p>
<h3>Supported Browsers</h3>
<p>Currently, the Image Caption script has been tested and confirmed on the following browsers:</p>
<ul>
<li>Internet Explorer 5.5+</li>
<li>Mozilla Firefox 1.5+</li>
<li>Apple Safari 2.0</li>
<li>Opera Version 8.51</li>
</ul>
<h4>Licensing</h4>
<p>This ReDsgn tool is licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.redsgn.com/2009/01/17/jquery-plugin-to-add-captions-to-images-from-image-attributes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
