<?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>Adventures In Development &#187; JQuery</title>
	<atom:link href="http://www.adventuresindevelopment.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adventuresindevelopment.com</link>
	<description>Web Development Tools, Ideas, Techniques and Resources</description>
	<lastBuildDate>Fri, 27 Aug 2010 04:11:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Create a Sortable HTML Table with JQuery and TableSorter</title>
		<link>http://www.adventuresindevelopment.com/2009/06/05/create-a-sortable-html-table-with-jquery-and-tablesorter/</link>
		<comments>http://www.adventuresindevelopment.com/2009/06/05/create-a-sortable-html-table-with-jquery-and-tablesorter/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 15:29:19 +0000</pubDate>
		<dc:creator>Matthew Paulson</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.adventuresindevelopment.com/?p=133</guid>
		<description><![CDATA[One of the more useful features of ASP.NET&#8217;s GridView control is that users can sort the information in the table they are seeing by any number of fields. To allow this sorting to happen, ASP.NET sends a post-back to the server and the web server re-renders the page with the GridView re-sorted in the order [...]]]></description>
			<content:encoded><![CDATA[<p>One of the more useful features of <a href="http://msdn.microsoft.com/en-us/library/aa479339.aspx">ASP.NET&#8217;s GridView control</a> is that users can sort the information in the table they are seeing by any number of fields. To allow this sorting to happen, ASP.NET sends a post-back to the server and the web server re-renders the page with the GridView re-sorted in the order requested. Now, there&#8217;s a way to display a table that can be sorted by any number of fields using only JavaScript. There&#8217;s no communication back and forth with the web-server wasting bandwidth and processing power on the web-server.</p>
<p>The JQuery library that allows this to happen is called <a href="http://tablesorter.com/docs/">Tablesorter</a>. Tablesorter has a ton of very useful features, including having a very small code base, the ability to sort across multiple columns and is compatible with just about every web-browser that&#8217;s currently being used, even IE 6. It has sort parsers for a number of types of formats, including text, URIs, integers, currency, floats, IP addresses and dates, so whatever type of data you have in the table, chances are it will be able to intelligently sort it.</p>
<p><span style="text-decoration: underline;"><strong>Here&#8217;s how to create a sortable table with TableSorter and JQuery</strong></span></p>
<p><strong>(1) Get the required libraries and reference them.</strong></p>
<p>You&#8217;ll want to download the minfiied version of Tablesorter from the Tablesorter website. The slimmed-down version comes in at 12 KB. You can download that <a href="http://tablesorter.com/jquery.tablesorter.min.js">here</a>. You&#8217;ll also want to get a copy of the latest version of JQuery which is available form the <a href="http://www.jquery.com/">JQuery Website</a>. Once you get those two files downloaded, you&#8217;ll want to add references to them in your page&#8217;s &lt;HEAD&gt;. They should look something like this depending on where you placed your files:</p>
<p>&lt;script src=&#8221;jquery.tablesorter.min.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;jquery-1.3.2.min.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</p>
<p><strong>(2) Make an HTML Table</strong></p>
<p>Here&#8217;s a demonstration table that the Tablesorter website provides for us to use. Simply add this to the body of your page:</p>
<pre class="html"><span class="tag">&lt;table</span><span class="aname"> id</span>=<span class="avalue">"myTable"</span><span class="tag">&gt;</span>
<span class="tag">&lt;thead</span><span class="tag">&gt;</span>
<span class="tag">&lt;tr</span><span class="tag">&gt;</span>
    <span class="tag">&lt;th</span><span class="tag">&gt;</span>Last Name<span class="tag">&lt;/th&gt;</span>
    <span class="tag">&lt;th</span><span class="tag">&gt;</span>First Name<span class="tag">&lt;/th&gt;</span>
    <span class="tag">&lt;th</span><span class="tag">&gt;</span>Email<span class="tag">&lt;/th&gt;</span>
    <span class="tag">&lt;th</span><span class="tag">&gt;</span>Due<span class="tag">&lt;/th&gt;</span>
    <span class="tag">&lt;th</span><span class="tag">&gt;</span>Web Site<span class="tag">&lt;/th&gt;</span>
<span class="tag">&lt;/tr&gt;</span>
<span class="tag">&lt;/thead&gt;</span>
<span class="tag">&lt;tbody</span><span class="tag">&gt;</span>
<span class="tag">&lt;tr</span><span class="tag">&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>Smith<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>John<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>jsmith@gmail.com<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>$50.00<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>http://www.jsmith.com<span class="tag">&lt;/td&gt;</span>
<span class="tag">&lt;/tr&gt;</span>
<span class="tag">&lt;tr</span><span class="tag">&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>Bach<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>Frank<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>fbach@yahoo.com<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>$50.00<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>http://www.frank.com<span class="tag">&lt;/td&gt;</span>
<span class="tag">&lt;/tr&gt;</span>
<span class="tag">&lt;tr</span><span class="tag">&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>Doe<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>Jason<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>jdoe@hotmail.com<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>$100.00<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>http://www.jdoe.com<span class="tag">&lt;/td&gt;</span>
<span class="tag">&lt;/tr&gt;</span>
<span class="tag">&lt;tr</span><span class="tag">&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>Conway<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>Tim<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>tconway@earthlink.net<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>$50.00<span class="tag">&lt;/td&gt;</span>
    <span class="tag">&lt;td</span><span class="tag">&gt;</span>http://www.timconway.com<span class="tag">&lt;/td&gt;</span>
<span class="tag">&lt;/tr&gt;</span>
<span class="tag">&lt;/tbody&gt;</span>
<span class="tag">&lt;/table&gt;</span></pre>
<p><strong>(3) Sort Your Table</strong></p>
<p>The only thing left to do to make our quick and dirty demo of the table sorter to work is to call the sorting library using the document.ready() function that&#8217;s frequently used with JQuery. That will look something like this:</p>
<p>&lt;script language=&#8221;javascript&#8221; type=&#8221;text/javascript&#8221;&gt;</p>
<p>$(document).ready(function()<br />
{<br />
$(&#8220;#myTable&#8221;).tablesorter();<br />
}<br />
);</p>
<p>&lt;/script&gt;</p>
<p><strong>(4) Further Development</strong></p>
<p>The next logical step is to add some CSS formatting that will give the user a better idea of which sort direction they&#8217;re doing. You can see a demo of how to style the different sort directions on the <a href="http://tablesorter.com/docs/#Configuration">Tablesorter website</a>, which would be a must on any production site. You might also want to play around with doing multi-column sorts and with their widget system.</p>
<p><a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/06/tablesorterdemo.zip">Click here to download my example code (24 KB)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adventuresindevelopment.com/2009/06/05/create-a-sortable-html-table-with-jquery-and-tablesorter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Validate Forms with JQuery</title>
		<link>http://www.adventuresindevelopment.com/2009/06/03/how-to-validate-forms-with-jquery/</link>
		<comments>http://www.adventuresindevelopment.com/2009/06/03/how-to-validate-forms-with-jquery/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 14:10:39 +0000</pubDate>
		<dc:creator>Matthew Paulson</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.adventuresindevelopment.com/?p=129</guid>
		<description><![CDATA[Just about everyone who&#8217;s ever made a web-application knows that you generally can&#8217;t trust your users to enter data correctly into a form. Some of them will ignore important fields, others will type in data that couldn&#8217;t possibly be right. Some will try to choose two character passwords and others will enter in a long [...]]]></description>
			<content:encoded><![CDATA[<p>Just about everyone who&#8217;s ever made a web-application knows that you generally can&#8217;t trust your users to enter data correctly into a form. Some of them will ignore important fields, others will type in data that couldn&#8217;t possibly be right. Some will try to choose two character passwords and others will enter in a long string of text when all you wanted to do was get their age in the form of numbers.</p>
<p>A lot of these errors can be mitigated by using the right input controls. You want to use the right HTML input control for the right situation.. You certainly wouldn&#8217;t want to use a textbox to have someone enter in their gender and you definitely don&#8217;t want to use a drop down list to have someone enter their email address. Although using the right input controls for the right questions takes a long way in helping ensure that we get good data, that alone isn&#8217;t enough.</p>
<p>When it comes to textboxes, you&#8217;ll often want to make sure whatever they type in meets a specific format, such as a phone-number or an email address. You might also want to make surethey actually do type -something- in, or make sure that they type the same thing in two fields if you want to confirm that something&#8217;s accurate.</p>
<p>Microsoft does a pretty good job of making this happen in <a href="http://www.w3schools.com/aspnet/aspnet_refvalidationcontrols.asp">ASP.NET with their validation controls</a>. More often than not, the validation controls will simply generate some javascript to perform the validation, but there&#8217;s also an option to have it validate at the server-side level. If you&#8217;d like to have a bit more control over your validators there&#8217;s some code in <a href="http://www.jquery.org/">JQuery</a> that we can use to make sure users what enter in good data.</p>
<p>The example code I&#8217;m going to demonstrate today is based off the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">JQuery Validate plugin</a>.</p>
<p><span style="text-decoration: underline;"><strong>Here&#8217;s How to Validate  Text Boxes with JQuery</strong></span></p>
<p><strong>(1) Download and Reference JQuery and the JQuery Validation Library</strong></p>
<p>You&#8217;ll need a copy of JQuery 1.2.6+ on your system, which can be <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.min.js">downloaded from Google</a>.You&#8217;ll also need a copy of the JQuery Validation library, <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">available from bassistance.de</a>. Once you get your two libraries download, you can extract the minified version of both of them into a folder, create a new HTML page and add your header references that should look something like this:</p>
<p>&lt;script src=&#8221;jquery.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;jquery.validate.min.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</p>
<p><strong>(2) Building your form</strong></p>
<p>For this example, we&#8217;ll make a basic contact form that requires the person to enter their name, their email address and some comments. All of the fields will be required and we will also make sure that the user&#8217;s email address was entered in the correct format.</p>
<p>Here&#8217;s what the form will look like:</p>
<p>&lt;form class=&#8221;cmxform&#8221; id=&#8221;commentForm&#8221; method=&#8221;get&#8221; action=&#8221;"&gt;<br />
&lt;fieldset&gt;<br />
&lt;p&gt;<br />
&lt;label for=&#8221;cname&#8221;&gt;Name&lt;/label&gt;<br />
&lt;em&gt;*&lt;/em&gt;&lt;input id=&#8221;cname&#8221; name=&#8221;name&#8221; size=&#8221;25&#8243; class=&#8221;required&#8221; minlength=&#8221;2&#8243; /&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;label for=&#8221;cemail&#8221;&gt;E-Mail Address&lt;/label&gt;<br />
&lt;em&gt;*&lt;/em&gt;&lt;input id=&#8221;cemail&#8221; name=&#8221;email&#8221; size=&#8221;25&#8243;  class=&#8221;required email&#8221; /&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;label for=&#8221;ccomment&#8221;&gt;Comments:&lt;/label&gt;<br />
&lt;em&gt;*&lt;/em&gt;&lt;textarea id=&#8221;ccomment&#8221; name=&#8221;comment&#8221; cols=&#8221;22&#8243;  class=&#8221;required&#8221;&gt;&lt;/textarea&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;input class=&#8221;submit&#8221; type=&#8221;submit&#8221; value=&#8221;Submit&#8221;/&gt;<br />
&lt;/p&gt;<br />
&lt;/fieldset&gt;<br />
&lt;/form&gt;</p>
<p>There are a few things to note about this form. First, that all of the inputs have been given a class of &#8220;required&#8221;. This is how the JQuery library will know whether or not to validate them. If you don&#8217;t want a field to be required, simply leave it out. You&#8217;ll also note on the &#8220;E-Mail Address&#8221; field, that it has a class of class=&#8221;required email&#8221;, this will let the function know that what the user enters in also has to be a valid email address.</p>
<p><strong>(3) Calling the Validation Method</strong></p>
<p>Finally, we need to invoke the validation method when the page loads. We can do this with the $(document).ready() function like this:</p>
<p>&lt;script&gt;<br />
$(document).ready(function(){<br />
$(&#8220;#commentForm&#8221;).validate();<br />
});<br />
&lt;/script&gt;</p>
<p>If you give you form a different ID, make sure that the ID of the form matches what you&#8217;re calling in your onLoad function.</p>
<p><strong>(4) The Results</strong></p>
<p>If all is well with your code, you should end up with something like this after clicking the submit button:</p>
<p><a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/06/form.jpg"><img class="alignnone size-full wp-image-130" title="form" src="http://www.adventuresindevelopment.com/wp-content/uploads/2009/06/form.jpg" alt="form" width="573" height="204" /></a></p>
<p>You can <a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/06/exvalidation.zip">download my example code here</a>. You can also <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">download the full JQuery Validation Library</a> with some more advanced examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adventuresindevelopment.com/2009/06/03/how-to-validate-forms-with-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JQuery Date Picker: One Step Torwards Making Forms That Work</title>
		<link>http://www.adventuresindevelopment.com/2009/05/28/jquery-date-picker-one-step-torwards-making-forms-that-work/</link>
		<comments>http://www.adventuresindevelopment.com/2009/05/28/jquery-date-picker-one-step-torwards-making-forms-that-work/#comments</comments>
		<pubDate>Thu, 28 May 2009 13:37:00 +0000</pubDate>
		<dc:creator>Matthew Paulson</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.adventuresindevelopment.com/?p=110</guid>
		<description><![CDATA[While attending Microsoft Mix earlier this spring, I stumbled upon a book called &#8220;Making Forms That Work&#8220;, which was written by Caroline Jarrett and Gerry Gaffney. The book focused on building web-forms that aren&#8217;t intimidating and that people will actually fill out. One of the focuses was making sure to use the right controls for [...]]]></description>
			<content:encoded><![CDATA[<p>While attending Microsoft Mix earlier this spring, I stumbled upon a book called &#8220;<a href="http://www.amazon.com/Forms-that-Work-Interactive-Technologies/dp/1558607102">Making Forms That Work</a>&#8220;, which was written by Caroline Jarrett and Gerry Gaffney. The book focused on building web-forms that aren&#8217;t intimidating and that people will actually fill out. One of the focuses was making sure to use the right controls for the right question you have for your user. You certainly don&#8217;t want a drop down list of 1000 names to have the user pickout their name, and you definitely don&#8217;t want to give them a text-box to type in their gender.</p>
<p>On that same line of reasoning, it&#8217;s probably not a good idea to have users manually type in dates. Considering all of the formats possible for entering a date, say &#8220;5/28/2009&#8243;, &#8220;5/28/09&#8243;, &#8220;Thursday, May 28th, 2009&#8243;, &#8220;May 28 09&#8243;, etc, you would need quite the number of regular expressions to determine if what the user entered in actually was a date. One solution to this is to draw a small calendar on the page and have the user click which date they want, but those often take up a lot of screen real estate.</p>
<p>Instead,  I usually recommend some sort of pop-up date picker. For ASP.NET, I&#8217;ll typically use the <a href="http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Calendar/Calendar.aspx">AJAX Control Toolkit Date Picker</a>. For other situations, I&#8221;ll make use of <a href="http://www.kelvinluck.com/assets/jquery/datePicker/">Kevin Luck&#8217;s JQuery DatePicker</a>. For more advanced date picking, you might also look into the  <a href="http://www.filamentgroup.com/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/">JQuery Date Range Picker</a>.</p>
<p><a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/calendar-extender.jpg"><img class="alignnone size-full wp-image-111" title="calendar-extender" src="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/calendar-extender.jpg" alt="calendar-extender" width="511" height="247" /></a></p>
<p><span style="text-decoration: underline;"><strong>For today&#8217;s project, we&#8217;ll make a basic implementation of Luck&#8217;s JQuery Date Picker.  Here&#8217;s </strong><strong>how to get started:</strong></span></p>
<p><strong>(1) Download the libraries</strong></p>
<p>For this project, we&#8217;re actually going to need a couple different libraries. We&#8217;ll need the <a href="http://www.jquery.org/">JQuery</a> library it self. You&#8217;ll also need the <a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/methods/date.js">date methods extension</a> for JQuery. After we have those two helper-libraries in place, we can download the <a href="http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/scripts/jquery.datePicker.js">JQuery Date Picker library it self</a> and the <a href="http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/styles/datePicker.css">associated CSS file</a>.</p>
<p><strong>(2) Create header references</strong></p>
<p>Now that we&#8217;ve got all of the libraries, we need to add some references in the header that should (for the most part, depending on where you put the files) look like this:</p>
<p>&lt;script src=&#8221;jquery-1.3.2.min.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;date.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;jquery.datePicker.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;<br />
&lt;link href=&#8221;datePicker.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; /&gt;</p>
<p><strong>(3) Create an input field for your datepicker</strong></p>
<p>With the datepicker, you&#8217;ll actually click the textbox itself or an associated image, and that will load the javascript popup that lets you pick out a date, and then the date picker will fill the value you choose into that textbox. Add an input tag to your page. Make sure to give it a class of &#8220;date-pick&#8221;.</p>
<pre id="line46">&lt;<span class="start-tag">input</span><span class="attribute-name"> name</span>=<span class="attribute-value">"date1" </span><span class="attribute-name">id</span>=<span class="attribute-value">"date1" </span><span class="attribute-name">class</span>=<span class="attribute-value">"date-pick" </span><span class="error"><span class="attribute-name">/</span></span>&gt;</pre>
<p><strong>(3) Call the date picker script</strong></p>
<p>Somewhere in the header, we&#8217;ll need to call the date picker script so that it loads when the page does.  That code should look like this:</p>
<p>&lt;script type=&#8221;text/javascript&#8221; charset=&#8221;utf-8&#8243;&gt;<br />
$(function()<br />
{<br />
$(&#8216;.date-pick&#8217;).datePicker();<br />
});<br />
&lt;/script&gt;</p>
<p><strong>(4) You&#8217;re done</strong></p>
<p>At this point, you should have something that looks like this (after you click on the &#8220;Choose Date&#8221; text):</p>
<p><a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/date-picker.jpg"><img class="alignnone size-full wp-image-112" title="date-picker" src="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/date-picker.jpg" alt="date-picker" width="341" height="171" /></a></p>
<p>Right now, it&#8217;s pretty ugly. The neat little calendar icon won&#8217;t be there, but <a href="http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePicker.html">you can add that by modifying the css</a>.You&#8217;ll probably also want to modify the color scheme to match the theme of your site. You can download <a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/date-pick-min.zip">my quick and dirty example code here (36 KB)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adventuresindevelopment.com/2009/05/28/jquery-date-picker-one-step-torwards-making-forms-that-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Crop Images in ASP.NET with &#8220;Web Crop Image Control&#8221;</title>
		<link>http://www.adventuresindevelopment.com/2009/05/22/how-to-crop-images-in-aspnet-with-web-crop-image-control/</link>
		<comments>http://www.adventuresindevelopment.com/2009/05/22/how-to-crop-images-in-aspnet-with-web-crop-image-control/#comments</comments>
		<pubDate>Fri, 22 May 2009 18:21:55 +0000</pubDate>
		<dc:creator>Matthew Paulson</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.adventuresindevelopment.com/?p=80</guid>
		<description><![CDATA[When researching various web-based imaging cropping tools, I&#8217;ve found that there are a lot of good looking JQuery, MooTools, and other JavaScript based solutions out there, but there&#8217;s not a ton of good server-side support. The one ASP.NET control I found that I really did like was &#8220;Asp.net 2.0 Web Crop Image Control&#8220;. It&#8217;s actually [...]]]></description>
			<content:encoded><![CDATA[<p>When researching various web-based imaging cropping tools, I&#8217;ve found that there are a lot of good looking JQuery, MooTools, and other JavaScript based solutions out there, but there&#8217;s not a ton of good server-side support. The one ASP.NET control I found that I really did like was &#8220;<a href="http://webcropimage.codeplex.com/">Asp.net 2.0 Web Crop Image Control</a>&#8220;. It&#8217;s actually an ASP.NET wrapper around <a href="http://deepliquid.com/content/Jcrop.html">JQuery JCrop</a>.</p>
<p><strong><span style="text-decoration: underline;">Here&#8217;s how to make a basic image cropper with the &#8220;Web Crop Image Control&#8221;:</span></strong></p>
<p><strong>(1) Download the source code from </strong><a href="http://webcropimage.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20913"><strong>CodePlex</strong></a><strong>. </strong></p>
<p><strong>(2) Create a new ASP.NET website in Visual Studio and add the included code from the sample website, including the DLL file it self from the &#8220;bin&#8221; directory, as well as the &#8220;scripts&#8221; directory and the &#8220;css&#8221; directory..</strong></p>
<p><strong>(3) Create a new ASP.NET Page and add in the following header reference to reference the crop control:</strong></p>
<p>&lt;%@ Register assembly=&#8221;CS.WebControls.WebCropImage&#8221; namespace=&#8221;CS.WebControls&#8221; tagprefix=&#8221;cc1&#8243; %&gt;</p>
<p><strong>(4) Add an ASP.NET Image Control to the Page:</strong></p>
<p>&lt;asp:Image ID=&#8221;Image1&#8243; runat=&#8221;server&#8221; ImageUrl=&#8221;images/samplephoto.jpg&#8221; /&gt;       </p>
<p><em>You can also set the vlaue of the image programmatically by setting the &#8220;ImageURL&#8221; property of your control.</em></p>
<p><strong>(5) Add a Crop Button to your page and give it an event handler:</strong></p>
<p>&lt;asp:Button ID=&#8221;btnCrop&#8221; runat=&#8221;server&#8221; Text=&#8221;Crop&#8221; onclick=&#8221;btnCrop_Click&#8221; /&gt;</p>
<p>Your corresponding C# code would look like this:</p>
<p>    protected void btnCrop_Click(object sender, EventArgs e)<br />
    {  <br />
        wci1.Crop(Server.MapPath(&#8220;~/images/filename.jpg&#8221;));<br />
    }</p>
<p><strong>(6) Add the Web Crop Image Control</strong></p>
<p>        &lt;cc1:WebCropImage ID=&#8221;wci1&#8243; runat=&#8221;server&#8221;<br />
            CropImage=&#8221;Image1&#8243;<br />
            IncludeJQuery=&#8221;true&#8221;<br />
            ScriptPath=&#8221;scripts/&#8221;  <br />
            W=&#8221;50&#8243;<br />
            H=&#8221;150&#8243; CropButtonID=&#8221;btnCrop&#8221;<br />
             /&gt;       </p>
<p><em>Make sure that the &#8220;CropImage&#8221; property is set to the name of the ASP.NET Image Control you created and that the CropButtonID is set to the ID of the button you created. You can change the default height and width by setting the H and W properties.</em></p>
<p>If all is well with your code, you should be good to go. Here&#8217;s what the finished product will look like:</p>
<p><a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/crop.jpg"><img class="alignnone size-full wp-image-81" title="crop" src="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/crop.jpg" alt="crop" width="478" height="353" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adventuresindevelopment.com/2009/05/22/how-to-crop-images-in-aspnet-with-web-crop-image-control/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Make an AJAX-like Multiple File Uploader with Uploadify</title>
		<link>http://www.adventuresindevelopment.com/2009/05/20/make-an-ajax-like-multiple-file-uploader-with-uploadify/</link>
		<comments>http://www.adventuresindevelopment.com/2009/05/20/make-an-ajax-like-multiple-file-uploader-with-uploadify/#comments</comments>
		<pubDate>Wed, 20 May 2009 18:40:41 +0000</pubDate>
		<dc:creator>Matthew Paulson</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.adventuresindevelopment.com/?p=68</guid>
		<description><![CDATA[I&#8217;m currently working on an file manager that will be integrated with the content management system software that we developed. In doing this, I&#8217;ve been looking for a solution that would allow users to upload multiple files at once, does so in a very easy to use way and shows a progress bar. For this [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on an file manager that will be integrated with the content management system software that we developed. In doing this, I&#8217;ve been looking for a solution that would allow users to upload multiple files at once, does so in a very easy to use way and shows a progress bar. For this project, I don&#8217;t really need to interact with ASP.NET at all for a database, so I can look at some of the JavaScript &amp; Flash solutions that are out there. The solution that I eventually settled on was <a href="http://www.uploadify.com/">Uploadify</a>. The tool is actually a combination of Flash and JQuery. It&#8217;s very customizable in the functionality that it offers as well as the design of the system.</p>
<p>I was at first concerned because the solution only supports PHP, however members of the Uploadify development community have developed a replacement server-sidescript that will replace the &#8220;upload.php&#8221; file with a .NET version. You can find <a href="http://www.uploadify.com/forum/viewtopic.php?f=5&amp;t=45">that code on their forums here</a>.</p>
<p><strong>Here&#8217;s what Uploadify looks like in action:</strong></p>
<p><a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/uploadify-example.jpg"><img class="alignnone size-full wp-image-69" title="uploadify-example" src="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/uploadify-example.jpg" alt="uploadify-example" width="364" height="312" /></a></p>
<p><strong><span style="text-decoration: underline;">Implementing Uploadify</span></strong></p>
<p><strong>Getting Started:</strong></p>
<p>So how do we implement Uploadify? It&#8217;s actually easier than many JQuery modules that are out there. The first thing you&#8217;ll need is the Uploadify Core <a href="http://www.uploadify.com/">that can be downloaded from the Uploadify website</a>. You can also download code for several examples of implementations of code. The core it self comes with a PDF manual as well.</p>
<p><strong>Script References:</strong></p>
<p>You&#8217;ll need to reference the latest version of the JQuery Core was well as the Uploadify JavaScript file:</p>
<p><code>&lt;link rel="stylesheet" href="uploadify/uploadify.css" type="text/css" /&gt;<br />
&lt;script type="text/javascript" src="js/jquery-1.3.2.min.js"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript" src="js/jquery.uploadify.js"&gt;&lt;/script&gt;<br />
</code><br />
<strong>Making a Placeholder:</strong></p>
<p>You&#8217;ll need a placeholder DIV that the script can use to draw the upload tool on the page somewhere in the &lt;BODY&gt; tag:</p>
<p><code>&lt;div id="fileUpload1"&gt;&lt;/div&gt;</code></p>
<p><strong>Calling the Script:</strong></p>
<p>Now, all we need to do is call the uploader when the page loads:</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
$(document).ready(function() {<br />
 $("#fileUpload1").fileUpload({<br />
  'uploader': 'uploadify/uploader.swf',<br />
  'cancelImg': 'uploadify/cancel.png',<br />
  'script': 'uploadify/upload.php',<br />
  'folder': 'files',<br />
  'multi': true,<br />
  'buttonText': 'Select Files',<br />
  'checkScript': 'uploadify/check.php',<br />
  'displayData': 'speed',<br />
  'simUploadLimit': 2<br />
 });<br />
});<br />
&lt;/script&gt;<br />
</code><br />
That&#8217;s all it really takes to implement Uploadify. You might want to modify some of the settings in it to customize the uploader to your needs, but it&#8217;s a really great solution.</p>
<p><strong>Here are some common options that you can play with in the settings:</strong></p>
<ul>
<li>&#8220;CheckScript&#8221; and &#8220;Script&#8221;  -&gt; Be sure to change these if you are using the .NET solution</li>
<li>sizeLimit -&gt; Limit the file size of the upload (in bytes)</li>
<li>Height &amp; Width -&gt; Change the dimensions of the container DIV</li>
<li>fileExt -&gt; Limit the type of file extensions that you allow.</li>
<li>ButtonText &amp; ButtonIMG -&gt; Customize the look of the upload button</li>
<li><a href="http://www.uploadify.com/documentation/">There&#8217;s a full list in the Uploadify Website</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.adventuresindevelopment.com/2009/05/20/make-an-ajax-like-multiple-file-uploader-with-uploadify/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How to Create a JQuery File Browser with JQuery File Tree</title>
		<link>http://www.adventuresindevelopment.com/2009/05/19/how-to-create-a-jquery-file-browser-with-jquery-file-tree/</link>
		<comments>http://www.adventuresindevelopment.com/2009/05/19/how-to-create-a-jquery-file-browser-with-jquery-file-tree/#comments</comments>
		<pubDate>Tue, 19 May 2009 14:34:56 +0000</pubDate>
		<dc:creator>Matthew Paulson</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.adventuresindevelopment.com/?p=56</guid>
		<description><![CDATA[While looking at various tools that might aid in the development of an ASP.NET based file manager, I came across a JQuery based tool called jQuery File Tree. Typically we would think of a file browser for a web-server that would be something that&#8217;s almost uniquely server-side, but jQuery File Tree does a nice job [...]]]></description>
			<content:encoded><![CDATA[<p>While looking at various tools that might aid in the development of an ASP.NET based file manager, I came across a JQuery based tool called <a href="http://abeautifulsite.net/notebook/58">jQuery File Tree</a>. Typically we would think of a file browser for a web-server that would be something that&#8217;s almost uniquely server-side, but jQuery File Tree does a nice job at putting a front-end on what otherwise would be a plain-jane FTP or HTTP file directory.</p>
<p><a href="http://abeautifulsite.net/notebook_files/58/demo/" target="_blank">You can view an online demo how it works here.</a></p>
<p><span style="text-decoration: underline;"><strong>Here&#8217;s how to make your very own JQuery File Browser/Viewer with JQuery File Tree:</strong></span></p>
<p><strong>Getting Started:</strong></p>
<p>First, you&#8217;ll need to download the latest version of JQuery File Browser. As of the time this article was written, the software is sitting at version 1.01 and can be downloaded <a href="http://abeautifulsite.net/notebook_files/58/jqueryFileTree.zip">here</a>. You&#8217;ll also need a copy of <a href="http://jquery.com/">JQuery</a> it self (version 1.2+) and if you would like some of the smoother transitions, you&#8217;ll want a copy of the <a href="http://gsgd.co.uk/sandbox/jquery/easing/">JQuery Easing Plugin</a>.</p>
<p><strong>Adding Script References:</strong></p>
<p>After getting copies of all of the files you need, you&#8217;ll want to open up your favorite HTML editor and create a new page. We&#8217;ll need to add references to the three scripts we&#8217;re making use of (JQuery, JQuery Easing and JQuery File Tree). You&#8217;ll also want to add a reference to the stylesheet for the file browser. Your &lt;HEAD&gt; should end up looking something like this:</p>
<p><code>&lt;script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;script src="jqueryFileTree.js" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;script src="jquery.easing.1.3.js" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;link rel="stylesheet" type="text/css" href="jqueryFileTree.css" media="screen" /&gt;</code></p>
<p><strong>Adding a Place Holder:</strong></p>
<p>The next thing we&#8217;ll need to do is put a DIV inside the &lt;BODY&gt; tag and give it an ID to reference by JQuery later and a class for CSS styling purposes. It should look something like this:</p>
<p><code>&lt;div id="JQueryFTD_Demo" class="</code><code>JQueryFTD</code><code>"&gt;&lt;/div&gt;<br />
</code><br />
<strong>Loading the File Browser</strong>:</p>
<p>Now that we have all of the &#8220;helper&#8221; components in place, we&#8217;ll need to call the function from the $(document).ready that is frequently used with JQuery.First, we&#8217;ll need to create our $(document).ready function which will sit in the &lt;HEAD&gt;</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
$(document).ready( function() {<br />
});<br />
&lt;/script&gt;<br />
</code></p>
<p>Now, inside of our $(document).ready function, we can call the JQuery File Tree function:</p>
<p><code>$('#JQueryFTD_Demo').fileTree({<br />
root: '/windows/',<br />
script: 'jqueryFileTree.aspx',<br />
expandSpeed: 1000,<br />
collapseSpeed: 1000,<br />
multiFolder: true<br />
}, function(file) {<br />
alert(file);<br />
});</code></p>
<p>There are several things to be aware of about the code above that you&#8217;ll need to know to successfully implement it. First, You&#8217;ll want to make sure that the ID of the DIV in your JQuery function matches that of the one on on the page. You should also note that the script is very picky about what you put in for the root directory. Make sure that the path is relative to the root on your hard-drive, not relative to the file it self. For example, when running the script on my local machine, I used /windows/ to display the files in my windows directory. You can also change the speed that a folder expands by modifying the &#8220;expandSpeed&#8221; and &#8220;collapseSpeed&#8221; fields.  Finally, if you want to be able to open only one file at a time, you&#8217;ll want to set &#8220;multiFolder&#8221; to false.</p>
<p>Another important aspect of the function is reference the appropriate server-side script. You&#8217;ll need this to generate the list of files on the web-server. I happened to use the ASP.NET version, but there are versions available for Java, Cold Fusion, PHP, Ruby, etc. All of them come with the standard JQueryFileTreePackage, just make sure to point it at the right file for language you&#8217;re using.</p>
<p>As the script is initially, using &#8220;alert(file);&#8221; will only display the name of the file in a popup. To make this useful, we&#8217;ll probably want to change that function out for one that will open the file it self. To do that, we could simply change &#8220;alert(file);&#8221; to &#8220;window.location = file;&#8221; You might have to write a function to parse the filename that it passes and make some adjustments so it redirects to the right file on the server, but it will work.</p>
<p><strong>Styling the Browser</strong></p>
<p>As we&#8217;re sitting right now, our file browser will fill up the entire page. I&#8217;m going to add some basic CSS to it to make it more manageable. To do this, simply add a CSS section in your header:</p>
<p><code><br />
&lt;style type="text/css" media="screen"&gt;<br />
.demo<br />
{<br />
width: 300px;<br />
height: 400px;<br />
border-top: solid 1px #BBB;<br />
border-left: solid 1px #BBB;<br />
border-bottom: solid 1px #FFF;<br />
border-right: solid 1px #FFF;<br />
background: #FFF;<br />
overflow: scroll;<br />
padding: 5px;<br />
}<br />
&lt;/style&gt;</code></p>
<p><strong>Completion:</strong></p>
<p>At this point, the script should be working if all is well with your code and you should end up with something like this:</p>
<p><a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/jqfile.jpg"><img class="size-full wp-image-58" title="jqfile" src="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/jqfile.jpg" alt="jqfile" width="332" height="421" /></a></p>
<p><a href="http://www.adventuresindevelopment.com/wp-content/uploads/2009/05/jqueryfiletreedemo.zip">Feel free to download my example code (49.5 KB)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adventuresindevelopment.com/2009/05/19/how-to-create-a-jquery-file-browser-with-jquery-file-tree/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Using JQuery? Let Google Host It</title>
		<link>http://www.adventuresindevelopment.com/2009/05/17/using-jquery-let-google-host-it/</link>
		<comments>http://www.adventuresindevelopment.com/2009/05/17/using-jquery-let-google-host-it/#comments</comments>
		<pubDate>Sun, 17 May 2009 23:28:45 +0000</pubDate>
		<dc:creator>Matthew Paulson</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.adventuresindevelopment.com/?p=37</guid>
		<description><![CDATA[In the last decade, Google has given us a lot of amazing free services, and web developers haven&#8217;t been left out of the party. For a while now, Google has been hosting popular JavaScript libraries on their CDN (content delivery network) and letting any website make use of them for free. On face, you might [...]]]></description>
			<content:encoded><![CDATA[<p>In the last decade, Google has given us a lot of amazing free services, and web developers haven&#8217;t been left out of the party. For a while now, Google has been hosting popular JavaScript libraries on their CDN (content delivery network) and letting any website make use of them for free. On face, you might not think that having Google host one JavaScript file for you would make any difference to you or your users at all.</p>
<p><strong>The Benefits</strong>:</p>
<p>It turns out, there&#8217;s actually a number of good reasons to let Google host JQuery and other commonly used javascript libraries for you. The first is caching. If your users have been to another site that references JQuery from Google, they will already have it cached on their system and won&#8217;t need to download it again, meaning that your website will load faster then. You also benefit from the fact that Google&#8217;s CDN can probably serve content a lot faster than your webhost. Google can serve the JQuery script to your users from dozens of different servers around the web and send it from whichever server is closest to your user.</p>
<p>Finally, you benefit that since your users are downloading the JQuery library from Google, they&#8217;re not downloading it from you. Most people don&#8217;t ever hit their bandwidth limitations from their web hosts, but if you have a content heavy site, saving 30 KB worth of bandwidth per visitor can add up pretty quickly.</p>
<p><strong>How to do it:</strong></p>
<p>There are actually two different ways to reference JQuery, MooTools, Scriptaculous, Prototype and other libraries from Google. Google has a a <a href="http://code.google.com/apis/ajaxlibs/">JavaScript AJAX libraries API</a> that you can use which will dynamically load your library of choice. This method is supposed to be faster than doing a direct reference, but some have reported that it can cause problems.</p>
<p>Here&#8217;s how to do it the way Google suggests:</p>
<p><code>&lt;script src="http://www.google.com/jsapi" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;&lt;!--<br />
google.load("jquery", "1.3.2");<br />
google.setOnLoadCallback(function() {<br />
// Place init code here instead of $(document).ready()<br />
});<br />
// --&gt;&lt;/script&gt;<br />
</code></p>
<p>Alternatively, you can do a good old fashioned script reference:</p>
<p><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adventuresindevelopment.com/2009/05/17/using-jquery-let-google-host-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Simple Image Rotator with JQuery</title>
		<link>http://www.adventuresindevelopment.com/2009/05/14/building-a-simple-image-rotator-with-jquery/</link>
		<comments>http://www.adventuresindevelopment.com/2009/05/14/building-a-simple-image-rotator-with-jquery/#comments</comments>
		<pubDate>Fri, 15 May 2009 03:21:17 +0000</pubDate>
		<dc:creator>Matthew Paulson</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.adventuresindevelopment.com/?p=11</guid>
		<description><![CDATA[I was recently working on a new website for an adult fellowship group at my church and one of the tasks I had was to create an image rotator that had various bible verses on it that would transition every few seconds. Since the site was Joomla-based, I initially searched for a free plugin that [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently working on a new website for an adult fellowship group at my church and one of the tasks I had was to create an image rotator that had various bible verses on it that would transition every few seconds. Since the site was Joomla-based, I initially searched for a free plugin that would do the trick. I did find one that would do the trick (<a href="http://www.joomlashack.com/extensions/170-flash-rotator-module-version-25-unbranded">Flash Rotator Module</a> by JoomlaShack), but it was $19.95. I decided I would keep looking and find a free solution.</p>
<p>Eventually I stumbled upon <a href="http://www.malsup.com/jquery/cycle/">JQuery Cycle</a>. It&#8217;s a free JQuery tool that lets you do an image rotator with a lot of unique transitions. I opted for a basic &#8220;fade&#8221;, since that&#8217;s what the previous version of the site was using. There&#8217;s also shuffle, zoom, rotation, and scrolling effects. You can see the results of these efforts on <a href="http://www.sfcontext.com/">http://www.sfcontext.com</a>/</p>
<p><span style="text-decoration: underline;"><strong>Here are the steps to recreate a basic image-slideshow using JQuery Cycle:</strong></span></p>
<p><strong>(1) Reference the JQuery Library and the JQuery Cycle Libraries in your &lt;HEAD&gt;.</strong></p>
<p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery-1.3.2.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;jquery.cycle.all.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</p>
<p><em>(You&#8217;ll need the <a href="http://docs.jquery.com/Downloading_jQuery">JQuery library</a> as well as the <a href="http://malsup.com/jquery/cycle/download.html">JQuery Cycle library</a> on your web-server, make sure to update your references)</em></p>
<p><strong>(2) Make a DIV with your images in it where you want the rotator to appear on your page:</strong></p>
<p>&lt;div class=&#8221;pics&#8221;&gt;<br />
&lt;img src=&#8221;/media/banners/1.jpg&#8221; width=&#8221;597&#8243; height=&#8221;175&#8243; /&gt;<br />
&lt;img src=&#8221;/media/banners/2.jpg&#8221; width=&#8221;597&#8243; height=&#8221;175&#8243; /&gt;<br />
&lt;img src=&#8221;/media/banners/3.jpg&#8221; width=&#8221;597&#8243; height=&#8221;175&#8243; /&gt;<br />
&lt;img src=&#8221;/media/banners/4.jpg&#8221; width=&#8221;597&#8243; height=&#8221;175&#8243; /&gt;<br />
&lt;/div&gt;</p>
<p><em>Feel free to use as many images as you want in this. You can also change the height and the width, but it&#8217;s probably a good idea that they all have the same height and width. You can also use &#8220;ALT&#8221; and &#8220;TITLE&#8221; tags since they&#8217;re plane-jane HTML image objects.</em></p>
<p><strong>(3) Use a $document.ready() function to load the JQuery Cycle rotator effects</strong></p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
$(document).ready(function() {<br />
$(&#8216;.pics&#8217;).cycle({<br />
fx:    &#8216;fade&#8217;,<br />
speed:  5000<br />
});<br />
});<br />
&lt;/script&gt;</p>
<p><em>make sure that the class of the DIV lines up with the class being referenced in the $document.ready() function. You can also replace the &#8220;fade&#8221; fx with </em>a <a href="http://http://malsup.com/jquery/cycle/download.html">number of other transitions</a> and change the speed as you desire. The &#8220;5000&#8243; represents 5000 miliseconds or 5 seconds.</p>
<p>Overall, I&#8217;m very impressed with JQuery Cycle as an image-rotator solution. The library it self is only 28KB when it&#8217;s compressed, and if you don&#8217;t include all of the transitions, you can shave a few kilobytes off that number.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adventuresindevelopment.com/2009/05/14/building-a-simple-image-rotator-with-jquery/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
