<?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>Vision Master Designs &#187; Ajax</title>
	<atom:link href="http://visionmasterdesigns.com/category/wp/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://visionmasterdesigns.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 29 Oct 2009 20:00:15 +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>Can you do this using Javascript ?!</title>
		<link>http://visionmasterdesigns.com/can-you-do-this-using-javascript/</link>
		<comments>http://visionmasterdesigns.com/can-you-do-this-using-javascript/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 15:50:39 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[Chrome Experiments]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://visionmasterdesigns.com/?p=1348</guid>
		<description><![CDATA[Ok, I was googling for some information when I stumbled upon something called as &#8220;Chrome Experiments&#8220;. I don`t know whether most of you must have seen this site, but it is unbelievable that most of the experiments posted here have been created using javascript ! One of my favourites here is the Depth of Field [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Fcan-you-do-this-using-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Fcan-you-do-this-using-javascript%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Ok, I was googling for some information when I stumbled upon something called as &#8220;<a href="http://www.chromeexperiments.com/">Chrome Experiments</a>&#8220;. I don`t know whether most of you must have seen this site, but it is unbelievable that most of the experiments posted here have been created using javascript !</p>
<p>One of my favourites here is the <a href="http://mrdoob.com/projects/chromeexperiments/depth_of_field/">Depth of Field example</a>. Screenies below</p>
<p><img class="alignleft" src="http://www.chromeexperiments.com/detail/depth-of-field/img/ahBjaHJvbWV4cGVyaW1lbnRzchcLEg9FeHBlcmltZW50SW1hZ2UY8oEPDA/large" alt="" width="240" height="180" /><img class="aligncenter" src="http://www.chromeexperiments.com/detail/depth-of-field/img/ahBjaHJvbWV4cGVyaW1lbnRzchcLEg9FeHBlcmltZW50SW1hZ2UYqpkPDA/large" alt="" width="240" height="180" /></p>
<p>This just shows how the javascript engines have evolved over the years. Earlier flash used to be every developer/designers dream to create super interactive websites, it is still great for creating RIAs but nowadays Javascript has evolved soo much, it can do most of the stuff which Flash could do.</p>
<p>This site is a real inspiration to those who want to learn more about javascript. Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/can-you-do-this-using-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A month long ordeal finally over ! Product = OptimaPrime, Result = First Prize</title>
		<link>http://visionmasterdesigns.com/a-month-long-ordeal-finally-over-product-optimaprime-result-first-prize/</link>
		<comments>http://visionmasterdesigns.com/a-month-long-ordeal-finally-over-product-optimaprime-result-first-prize/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 15:57:21 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[First prize]]></category>
		<category><![CDATA[Optimaprime]]></category>
		<category><![CDATA[Project Management System]]></category>

		<guid isPermaLink="false">http://visionmasterdesigns.com/?p=1116</guid>
		<description><![CDATA[Ok, so the title doesn`t make much sense huh !? I wasn`t available for an entire month and the reason&#8230;. Optima Prime &#8211; Enterprise Project Management System. Well,  this is my last year in graduation college and we had to create a project which will stand out, and here it is So wat is it [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Fa-month-long-ordeal-finally-over-product-optimaprime-result-first-prize%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Fa-month-long-ordeal-finally-over-product-optimaprime-result-first-prize%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Ok, so the title doesn`t make much sense huh !? I wasn`t available for an entire month and the reason&#8230;. <strong>Optima Prime &#8211; Enterprise Project Management System. </strong>Well,  this is my last year in graduation college and we had to create a project which will stand out, and here it is <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <strong></strong></p>
<p style="text-align: center;"><a title="Logo" href="http://visionmasterdesigns.com/?attachment_id=1117"><img class="attachment wp-att-1117 centered" src="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/03/logo.png" alt="Logo" width="300" height="80" /></a></p>
<h3>So wat is it all about ?</h3>
<p>Before I start, we had developed a Chart or Poster to depict what our software is all about. This is the poster, it may be a lil cluttered, but it pretty much explains what our project is all about <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>We won the first prize for our project along with another Project (Rank Retrieval System). But more than prize, I guess for all the hard work put in, we have got what we wanted, <strong>Exposure</strong>&#8230;.</p>
<p style="text-align: center;"><a title="poster" href="http://visionmasterdesigns.com/?attachment_id=1121"><img class="attachment wp-att-1121 centered" src="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/03/poster.thumbnail.png" alt="poster" width="300" height="225" /></a></p>
<h3>What is PMS ?</h3>
<p>There are lot of Project Management Systems out there, Project Management Systems (PMS) in general help your company manage projects effeciently and effectively. Optima Prime is one such PMS which does both alongside a host of features <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Features ?</h3>
<ol>
<li>Works on our Custom MVC based framework &#8220;Innovite&#8221;</li>
<li>3 Different types of User Logins viz Project Manager, Team Leader, Team Member</li>
<li>Every Project has an individual &#8220;Message Board&#8221;(Forum) to communicate with the project members with Attachment Facility</li>
<li>Email Alert System. Whenever any project has been updated or any new message has been added, then an E-Mail is sent across all the users in that project.</li>
<li>Completely AJAX &#8216;ed so not much page transitions</li>
<li>Dynamic Timeline Charts (Gantt) and Dynamic Pie/Bar Charts</li>
<li>Automatic PDF report generation.</li>
<li>Themes</li>
<li>Install Package</li>
<li>Aimed for an IT Enterprise</li>
<li>Plugin System</li>
<li>Open Source</li>
</ol>
<p>The basic framework of OptimaPrime.</p>
<p style="text-align: center;"><a title="howitworks" href="http://visionmasterdesigns.com/a-month-long-ordeal-finally-over-product-optimaprime-result-first-prize/howitworks/"><img class="attachment wp-att-1129 centered" src="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/03/howitworks.thumbnail.jpg" alt="howitworks" width="300" height="224" /></a></p>
<p>So there are a long list of features, I have just given a few. Anyways, I`ll release the code soon here, till then you can check out the screenshots put up below.</p>
<h3>Screenshots</h3>
<p style="text-align: center;"><a title="Summary" href="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/03/first-page.png"><img class="attachment wp-att-1118 centered" src="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/03/first-page.thumbnail.png" alt="Summary" width="300" height="224" /></a><br />
Project Dashboard after logging in</p>
<p style="text-align: center;"><a title="Project Summary Page with Gantt Chart, Pie Charts etc" href="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/03/page-summary.png"><img class="attachment wp-att-1119 centered" src="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/03/page-summary.thumbnail.png" alt="Project Summary Page with Gantt Chart, Pie Charts etc" width="204" height="300" /></a><br />
Project Summary Page with Gantt Chart, Pie Charts etc</p>
<p style="text-align: center;"><a title="Project Edit Page" href="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/03/page-edit.png"><img class="attachment wp-att-1120 centered" src="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/03/page-edit.thumbnail.png" alt="Project Edit Page" width="204" height="300" /></a><br />
Project Edit Page</p>
<p>Well, these are just a few screens, there are more. I`ll upload em as soon as I get up.</p>
<p>Cheers Guys, I am extremely sorry readers for not answering your queries, but I am here now. I`ll try to answer as much as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/a-month-long-ordeal-finally-over-product-optimaprime-result-first-prize/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Really Easy Form/Field Validation using Prototype+Scriptaculous</title>
		<link>http://visionmasterdesigns.com/really-easy-formfield-validation-using-prototypescriptaculous/</link>
		<comments>http://visionmasterdesigns.com/really-easy-formfield-validation-using-prototypescriptaculous/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 15:51:07 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Prototype, Script.aculo.us]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Form Validation]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Script.aculo.us]]></category>

		<guid isPermaLink="false">http://visionmasterdesigns.com/?p=1101</guid>
		<description><![CDATA[Hey Guys, Its been a while since I have started my final year Project called &#8220;OptimaPrime- The Enterprise Project Management System&#8221;. Most of you must have heard of project management systems. It helps enterprises manage their projects, lets them keep it on schedule, helps them allocate resources etc. I needed to perform form Validation since [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Freally-easy-formfield-validation-using-prototypescriptaculous%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Freally-easy-formfield-validation-using-prototypescriptaculous%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Hey Guys,</p>
<p>Its been a while since I have started my final year Project called &#8220;OptimaPrime- The Enterprise Project Management System&#8221;. Most of you must have heard of project management systems. It helps enterprises manage their projects, lets them keep it on schedule, helps them allocate resources etc.<br />
I needed to perform form Validation since I had a lot of forms and it had lot of fields. I googled for good form validation plugins for Prototype + Scriptaculous (Since I have got really used to this cool library) and thats when I found <a href="http://tetlaw.id.au/view/javascript/really-easy-field-validation" target="_blank">Dexagogo&#8217;s Really Easy Field Validation plugin</a>.</p>
<p style="text-align: center;"><span id="more-1101"></span><img class="attachment wp-att-1105 centered" src="http://visionmasterdesigns.com/wordpress/wp-content/uploads/2009/02/validation1.thumbnail.jpg" alt="validation1" width="300" height="225" /></p>
<p>A very useful and a simple to use form validator for all kinds of forms. It has neat Fade IN/Fade OUT effects too. Custom classes can be defined, custom validations can be defined. It validates fields for a lot of different type of scenarios.</p>
<ul>
<li><code>required</code> (not blank)</li>
<li><code>validate-number</code> (a valid number)</li>
<li><code>validate-digits</code> (digits only)</li>
<li><code>validate-alpha</code> (letters only)</li>
<li><code>validate-alphanum</code> (only letters and numbers)</li>
<li><code>validate-date</code> (a valid date value)</li>
<li><code>validate-email</code> (a valid email address)</li>
<li><code>validate-url</code> (a valid URL)</li>
<li><code>validate-date-au</code> (a date formatted as; dd/mm/yyyy)</li>
<li><code>validate-currency-dollar</code> (a valid dollar value)</li>
<li><code>validate-selection</code> (first option e.g. &#8216;Select one&#8230;&#8217; is not selected option)</li>
<li><code>validate-one-required</code> (At least one textbox/radio element must be selected in a group &#8211; see below*)</li>
</ul>
<p>For more information on how to use this plugin visit  <a href="http://tetlaw.id.au/view/javascript/really-easy-field-validation" target="_blank">Dexagogo&#8217;s Website</a>. You can also check out a demo of this script at action <a href="http://tetlaw.id.au/upload/pages/really-easy-field-validation/" target="_blank">HERE</a>. It has very good documentation on how to use this plugin. Thanks Dexagogo. Although if you guys have any doubt on how to use it, I`ll be glad to help you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/really-easy-formfield-validation-using-prototypescriptaculous/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial : Overlay a AJAX Spinner in the center of Web Page using Prototype</title>
		<link>http://visionmasterdesigns.com/tutorial-adding-a-ajax-spinner-in-the-center-of-web-page-using-prototype/</link>
		<comments>http://visionmasterdesigns.com/tutorial-adding-a-ajax-spinner-in-the-center-of-web-page-using-prototype/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 11:51:52 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[Prototype, Script.aculo.us]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Script.aculo.us]]></category>
		<category><![CDATA[Spinner]]></category>

		<guid isPermaLink="false">http://visionmasterdesigns.com/?p=1063</guid>
		<description><![CDATA[This tutorial is specially for beginners who are wondering how to place an AJAX Spinner. Its very simple guys. Just read below to find out. To those people who have wondered how to show the spinner image + loading message when any ajax request is made and to hide the spinner image + loading message [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-adding-a-ajax-spinner-in-the-center-of-web-page-using-prototype%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-adding-a-ajax-spinner-in-the-center-of-web-page-using-prototype%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This tutorial is specially for beginners who are wondering how to place an AJAX Spinner. Its very simple guys. Just read below to find out.</p>
<p>To those people who have wondered how to show the spinner image + loading message when any ajax request is made and to hide the spinner image + loading message when the request is successfully completed, this tutorial will help you out in achieving it and also teaches you how to show this loading box in the center of the browser screen and grey out the background contents with cool fade effects.</p>
<h3>Index :</h3>
<ul>
<li>Page 1 : <a href="http://visionmasterdesigns.com/tutorial-adding-a-ajax-spinner-in-the-center-of-web-page-using-prototype/2/">Introduction</a></li>
<li>Page 2 : <a href="http://visionmasterdesigns.com/tutorial-adding-a-ajax-spinner-in-the-center-of-web-page-using-prototype/2/">Required HTML/Javascript Code/CSS</a></li>
<li>Page 3 : <a href="http://visionmasterdesigns.com/tutorial-adding-a-ajax-spinner-in-the-center-of-web-page-using-prototype/3/">Complete Code of Demo</a></li>
</ul>
<h3>Pre-Requisites :</h3>
<p>A little bit of CSS,HTML knowledge and know-how of Prototype, Scriptaculous.</p>
<p><span id="more-1063"></span></p>
<h3>Source/Demo :</h3>
<div style="margin: 0pt auto; text-align: center; width: 320px;"><a href="http://www.visionmasterdesigns.com/demo/spinner/" target="_blank"><br />
<img style="margin-right:10px;" src="http://visionmasterdesigns.com/wordpress/wp-content/themes/VMD3/images/demo.jpg" border="0" alt="View Demo" width="147" height="72" /></a><a href="http://www.visionmasterdesigns.com/demo/spinner/spinner-source.zip"><img src="http://visionmasterdesigns.com/wordpress/wp-content/themes/VMD3/images/source.jpg" border="0" alt="Download Source" width="147" height="72" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/tutorial-adding-a-ajax-spinner-in-the-center-of-web-page-using-prototype/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>A cool jQuery plugin : PHP / jQuery Image Replacement</title>
		<link>http://visionmasterdesigns.com/a-cool-jquery-plugin-php-jquery-image-replacement/</link>
		<comments>http://visionmasterdesigns.com/a-cool-jquery-plugin-php-jquery-image-replacement/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 18:20:53 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Plugin]]></category>
		<category><![CDATA[PHP & MySQL]]></category>

		<guid isPermaLink="false">http://visionmasterdesigns.com/?p=1051</guid>
		<description><![CDATA[How many times have you wanted to use a very cool looking font for your website, but have withdrawn the idea because you thought that font won`t display properly in everyones&#8217;s system. Well fear not, I had previously posted a tutorial on how you can use PHP to display those lines of texts which use [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Fa-cool-jquery-plugin-php-jquery-image-replacement%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Fa-cool-jquery-plugin-php-jquery-image-replacement%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>How many times have you wanted to use a very cool looking font for your website, but have withdrawn the idea because you thought that font won`t display properly in everyones&#8217;s system. </p>
<p>Well fear not, I had previously posted a tutorial on how you can use PHP to display those lines of texts which use some odd font, by automatically converting it to an image (<a title="Tutorial : Convert Text into transparent PNG Image using PHP" rel="bookmark" href="http://visionmasterdesigns.com/tutorial-convert-text-into-transparent-png-image-using-php/">Tutorial : Convert Text into transparent PNG Image using PHP</a>), this way, you can easily display text with odd fonts.</p>
<p>Recently I found a very neat plugin which automatically converts any text (with font of your choice) into an image i.e from now on you don`t have to worry about text with different or odd fonts. They`ll be automatically converted into a compatible image via this plugin, And don`t worry about the image tag and all, this plugin manages everything <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Plugin name : PHP / jQuery Image Replacement<br />
Plugin Home Page/Demo : <a href="http://www.xanthir.com/pir/">http://www.xanthir.com/pir/</a></p>
<h3>Usage</h3>
<p>The usage was pretty simple.</p>
<ol>
<li>After unzipping the archive, Open <h7>pir.php</h7> and First set the fonts folder in the php page.</li>
<li>In your website, include jQuery and then include the <h7>jquery.pir.min.js</h7> (for production).</li>
<li>
<pre class="brush: javascript">
$(function() {
$.pir.options.php=&quot;pir.php&quot;; //compulsary to include the php which converts text to image.
$(&quot;h1&quot;).pir({font: &quot;yourfont.ttf&quot;, wrap: true}); //will enable automatic text warping.
</pre>
<p>});</li>
</ol>
<p>Pretty Simple huh ! Enjoy <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/a-cool-jquery-plugin-php-jquery-image-replacement/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tutorial : Collapsible Menus using jQuery</title>
		<link>http://visionmasterdesigns.com/tutorial-collapsible-menus-using-jquery/</link>
		<comments>http://visionmasterdesigns.com/tutorial-collapsible-menus-using-jquery/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 07:00:36 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Collapsible Menus]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.visionmasterdesigns.com/?p=856</guid>
		<description><![CDATA[A simple tutorial to show how I have achieved a nice,smooth Collapsible Menu Effect used in this site. (Example : The Category section in the sidebar in this site).]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-collapsible-menus-using-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-collapsible-menus-using-jquery%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>jQuery has surely made my life easier. I have been trying out both Prototype &amp; jQuery for a couple of days now and for some reason, I find jQuery a lil easier compared to Prototype Javascript Library. Although Prototype is a much powerful library (according to me), jQuery is just too simple <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Anyways I will show you a simple effect which you already must have seen in many places.</p>
<p><strong>Demo :</strong> The Category section in the sidebar in this site.</p>
<p><em><strong>EDIT :</strong> Added Collapse All, Expand All Code as well</em><br />
<span id="more-856"></span><br />
This code can be extended in creating a full-fledged dynamic Collapsible Menu. Mainly you can use this code in you Blogs (if you have a large array of Categories) to group your categories/tags.</p>
<pre class="brush: javascript">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js&quot; &gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){

//Store Image paths
var toggleMinus = &#039;path/to/minus/image&#039;;
var togglePlus = &#039;path/to/plus/image&#039;;

var $subHead = $(&#039;.children&#039;).parent();

//Add the Plus image to every child by default
$subHead.prepend(&#039;&lt;img src=&quot;&#039; + togglePlus + &#039;&quot; alt=&quot;collapse this section&quot; /&gt; &#039;);

//By Default put the Menu in collapsed state
$(&#039;.children&#039;).parent().children(&#039;ul&#039;).slideUp(&#039;fast&#039;);

//Expand All Code
$(&#039;.expand&#039;).click(function() {
		$subHead.children(&#039;ul&#039;).slideDown(&#039;fast&#039;);
		$(&#039;img&#039;, $subHead).attr(&#039;src&#039;, toggleMinus);
});

//Contract All Code
$(&#039;.contract&#039;).click(function() {
		$subHead.attr(&#039;src&#039;, toggleMinus).children(&#039;ul&#039;).slideUp(&#039;fast&#039;);
		$(&#039;img&#039;, $subHead).attr(&#039;src&#039;, togglePlus);
});

//Expand or Contract one particular Nested ul
$(&#039;img&#039;, $subHead).addClass(&#039;clickable&#039;).click(function() {
var toggleSrc = $(this).attr(&#039;src&#039;);
if ( toggleSrc == toggleMinus ) {
$(this).attr(&#039;src&#039;, togglePlus).parent().children(&#039;ul&#039;).slideUp(&#039;fast&#039;);
} else{
$(this).attr(&#039;src&#039;, toggleMinus).parent().children(&#039;ul&#039;).slideDown(&#039;fast&#039;);
};
});
});
&lt;/script&gt;
</pre>
<p>Basically <span class="code">.children</span> can be kept same if you are planning to use this in your WordPress Blog (for Categories or any unordered list or ordered list since WordPress assigns class=children to nested lists)</p>
<p>If you want to use this code in some other form, then <span class="code">.children</span> has to be replaced with the class name of the nested list. For Example, the above code works for lists like</p>
<pre class="brush: html">
&lt;a href=&quot;javascript:void(0);&quot; class=&quot;expand&quot;&gt;Expand All&lt;/a&gt;
&lt;a href=&quot;javascript:void(0);&quot; class=&quot;contract&quot;&gt;Contract All&lt;/a&gt;
&lt;ul&gt;
	&lt;li&gt;Main 1
&lt;ul class=&quot;children&quot;&gt;
	&lt;li&gt;Sub 1&lt;/li&gt;
	&lt;li&gt;Sub 2&lt;/li&gt;
	&lt;li&gt;Sub 3&lt;/li&gt;
	&lt;li&gt;Sub 4&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
	&lt;li&gt;Main 2
&lt;ul class=&quot;children&quot;&gt;
	&lt;li&gt;Sub 1&lt;/li&gt;
	&lt;li&gt;Sub 2&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
	&lt;li&gt;Main 3&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>This is how it looks. (I haven`t added Expand All and Collapse All in the Demo Here)</p>
<ul>
<li>Main 1
<ul class="children">
<li>Sub 1</li>
<li>Sub 2</li>
<li>Sub 3</li>
<li>Sub 4</li>
</ul>
</li>
<li>Main 2
<ul class="children">
<li>Sub 1</li>
<li>Sub 2</li>
</ul>
</li>
<li>Main 3</li>
</ul>
<p>You can style the unordered list not to display the bullets using CSS which I haven`t shown above.</p>
<p>I hope you guys enjoyed this post. If you guys have any questions, your comments are welcome.<br />
Signing off.</p>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/tutorial-collapsible-menus-using-jquery/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Tutorial : Auto Completer using Prototype, Script.aculo.us</title>
		<link>http://visionmasterdesigns.com/tutorial-auto-completer-using-prototype-scriptaculous/</link>
		<comments>http://visionmasterdesigns.com/tutorial-auto-completer-using-prototype-scriptaculous/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 13:35:43 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[Prototype, Script.aculo.us]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.visionmasterdesigns.com/?p=770</guid>
		<description><![CDATA[How many of you have always dreamt of creating an Auto Suggest Box. I bet everyone must have seen one of these somewhere or the other. if you use Gmail to send mails, you might recall that while typing the To address, Gmail shows a probable list of users from your address book. Nowadays most [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-auto-completer-using-prototype-scriptaculous%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-auto-completer-using-prototype-scriptaculous%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>How many of you have always dreamt of creating an Auto Suggest Box. I bet everyone must have seen one of these somewhere or the other. if you use Gmail to send mails, you might recall that while typing the To address, Gmail shows a probable list of users from your address book. Nowadays most of the modern browsers also have this Auto Suggest control built in them, i.e when the user begins to type in a text box, a menu appears below the text offering completion suggestions. </p>
<p>Today I am going to teach you how to create an Auto Suggest Box using Prototype, Script.aculo.us. The script.aculo.us auto suggest box (autocompleter) replicates this control, but gives the developer control of the probable suggestions.</p>
<p>Index</p>
<ul>
<li>Page 1 : <a title="Introduction" href="http://www.visionmasterdesigns.com/2008/10/tutorial-auto-completer-using-prototype-scriptaculous/">Introduction and </a></li>
<li>Page 2 : <a title="Auto Suggest Box (local)" href="http://www.visionmasterdesigns.com/2008/10/tutorial-auto-completer-using-prototype-scriptaculous/2/">Auto Suggest Box (local)</a></li>
<li>Page 3 : <a title="AJAX Auto Suggest Box (remote via PHP/MySQL)" href="http://www.visionmasterdesigns.com/2008/10/tutorial-auto-completer-using-prototype-scriptaculous/3/">AJAX Auto Suggest Box (remote via PHP/MySQL)</a></li>
</ul>
<h4>Demo &amp; Source Download</h4>
<p>Type out the name of the states of U.S.A.<br />
Local Auto Suggest Box Demo : <a href="http://www.visionmasterdesigns.com/demo/autocompleter/local.html" target="_blank">Click Here</a><br />
Remote Auto Suggest Box Demo : <a href="http://www.visionmasterdesigns.com/demo/autocompleter/ajax.html" target="_blank">Click Here</a></p>
<p>Download Source <a href="http://www.visionmasterdesigns.com/demo/autocompleter/autocompleter_src.rar">Here</a><br />
<span id="more-770"></span></p>
<h2>Problem Statement</h2>
<p>Lets try creating an Auto Suggest Box which displays the states of America as the user begins to type a state&#8217;s name in the text box.</p>
<h2>Solution</h2>
<p>Before using any functions, first we need to make our HTML page i.e how the suggestion box is going to look.</p>
<ol>
<li>Create an empty HTML file.</li>
<li>
    First, to take the input of any state name from the user we need an input box.<br />
    Second, we need a container to display all the probable suggestions i.e different names of states according to User input.</p>
<p>    Lets create these right now.</p>
<pre class="brush: html">
    &lt;!-- This code will be added inside the  &lt;strong&gt;&lt;BODY&gt;&lt;/strong&gt; tag of the HTML page --&gt;
    &lt;input type=&quot;text&quot; name=&quot;state_input&quot; id=&quot;state_input&quot; size=&quot;30&quot; /&gt;
    &lt;div id=&quot;state_suggestions&quot;&gt;&lt;!-- container for list of probable suggestions !--&gt;&lt;/div&gt;
    </pre>
</li>
<li>
    Now that we have designed our suggestion box, its time to implement the Auto Suggest Box method. Since this method is readily available as a part of Script.aculo.us, we need to include the scriptaculous file, and since scriptaculous depends on prototype, we need to include the prototype file to our HTML document. Type following code inside the <strong>&lt;HEAD&gt;</strong> tag.</p>
<pre class="brush: javascript">
	&lt;script src=&quot;js/lib/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;js/src/scriptaculous.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    </pre>
</li>
<li>
	The HTML page should look something like this.</p>
<pre class="brush: html">
    &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
    &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
    &lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
    &lt;title&gt;Untitled Document&lt;/title&gt;
    &lt;script src=&quot;js/lib/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
	&lt;script src=&quot;js/src/scriptaculous.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;input type=&quot;text&quot; name=&quot;state_input&quot; id=&quot;state_input&quot; size=&quot;30&quot; /&gt;
    &lt;div id=&quot;state_suggestions&quot;&gt;&lt;!-- container for list of probable suggestions !--&gt;&lt;/div&gt;

    &lt;/body&gt;
    &lt;/html&gt;
    </pre>
</li>
</ol>
<p>Now that we have a HTML page ready, preview it. Obviously it won&#8217;t work yet. We still have to define the AutoCompleter function.</p>
<p>There are 2 ways to achieve our goal. Script.aculo.us&#8217;s Autocompleter comes in two flavors.</p>
<ol>
<li><span class="code">Autocompleter.Local</span> : The local array autocompleter. Used when you’d prefer to inject an array of autocompletion options into the page, rather than sending out Ajax queries.</li>
<li><span class="code">Ajax.Autocompleter</span> : Which relies on a remote server to give it suggestions, making an AJAX Request whenever suggestions need to be retrieved.</li>
</ol>
<p>Now both have thier Pros and Cons. I`ll explain each one of them and how they can be used.</p>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/tutorial-auto-completer-using-prototype-scriptaculous/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Tutorial : Introduction to AJAX in Ruby on Rails with Prototype, Script.aculo.us</title>
		<link>http://visionmasterdesigns.com/tutorial-introduction-to-ajax-in-ruby-on-rails-with-prototype-scriptaculous/</link>
		<comments>http://visionmasterdesigns.com/tutorial-introduction-to-ajax-in-ruby-on-rails-with-prototype-scriptaculous/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 16:40:43 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[Prototype, Script.aculo.us]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.visionmasterdesigns.com/?p=684</guid>
		<description><![CDATA[Heya, After a long time I had the time to update my blog. I have been working on my project presentation for the past 2 weeks. The entire presentation was developed in Flash CS3 coded in ActionScript 3. It was ages since I had used Flash and I was quite astonished how it had changed [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-introduction-to-ajax-in-ruby-on-rails-with-prototype-scriptaculous%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-introduction-to-ajax-in-ruby-on-rails-with-prototype-scriptaculous%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Heya,<br />
After a long time I had the time to update my blog. I have been working on my project presentation for the past 2 weeks. The entire presentation was developed in Flash CS3 coded in ActionScript 3. It was ages since I had used Flash and I was quite astonished how it had changed over the years. I`ll be soon posting some tutorials on Flash, so do keep an eye out <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Anyways apart from being a bit off-topic, This tutorial deals with AJAX implementation in Ruby on Rails 2. While I was learning RoR, I had lot of issues of properly having AJAX implementation in my projects. This tuorial is for those people out there.</p>
<p>In this tutorial, I`ll just show some very simple Script.aculo.us Animation Implementations in RoR.<br />
<a href="http://www.visionmasterdesigns.com:12001/ajaxfunction" target="_blank">View Demo</a></p>
<p><span id="more-684"></span></p>
<h2>Introduction</h2>
<p>First off, if you followed my RoR tutorials, you should know that RoR has AJAX support built in to it. It uses the Prototype Javascript Library along with Scriptaculous.</p>
<h2>Step 1 &#8211; Create new RoR Application</h2>
<p>First create a new RoR application. Edit the <span class="code">database.yml</span> file as well. If you are new to RoR, then visit <a href="http://www.visionmasterdesigns.com/2008/07/tutorial-developing-your-first-ruby-on-rails-2-application/">Tutorial : Developing your First Ruby on Rails 2 Application</a></p>
<h2>Step 2 &#8211; Create a Controller</h2>
<p>After creating the new application, we need to create a controller. lets call the controller <span class="code">ajaxfunctions</span>. I hope you guys know how to create a controller.</p>
<pre lang="ruby">    ruby script/generate controller ajaxfunctions index</pre>
<p>The above code will create a controller called <span class="code">ajaxfunctions</span> which will have a method called <span class="code">index</span>, respectively <span class="code">index.rhtml</span> OR <span class="code">index.html.erb</span> will be created inside the <strong>view/ajaxfunctions</strong> folder.</p>
<h2>Step 3 &#8211; Editing the view file</h2>
<p>Once you open it, you`ll notice that its empty. This is our template, basic HTML would suffice. So type out an html page here or you can use the one below.</p>
<pre class="brush: html">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Great. Now firstly, to implemenet AJAX in RoR , we need to initialize it.</p>
<h4>Initializing the Ajax code</h4>
<p>You must include the javascript code in your view template file (i.e index.rhtml in our case) for the Ajax functions to be available in that view. The best place for this is in the <span class="code">&lt;head&gt;</span> tag.</p>
<p>You can either use</p>
<ul>
<li><span class="code">&lt;%= javascript_include_tag  :defaults %&gt;</span><br />
We`ll be using this. Using this allows for quicker downloads since the script can be cached by the browsers.<br />
This is the output in the HTML page.</p>
<pre class="brush: html">
&lt;html&gt;
&lt;head&gt;
...
&lt;script src=&quot;/javascripts/prototype.js?1219423129&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;/javascripts/effects.js?1219423129&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;/javascripts/dragdrop.js?1219423129&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;/javascripts/controls.js?1219423129&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;/javascripts/application.js?1219423129&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
...
&lt;/head&gt;
&lt;/html&gt;
</pre>
</li>
<li><span class="code">&lt;%= define_javascript_functions %&gt;</span><br />
This pastes all of the required Javascript code right into your view which increases your page size by ~20KB.</li>
</ul>
<h4>Different AJAX Helpers used in View Files</h4>
<p>RoR creates the AJAX code for you via helper codes. Firstly</p>
<p><em>Defination:</em><br />
<strong>What is a Helper</strong> ?<br />
<strong>Helpers</strong> (“view helpers”) are modules that provide methods which are automatically usable in your view. They provide shortcuts to commonly used display code and a way for you to keep the programming out of your views. The purpose of a helper is to simplify the view. It’s best if the view file (RHTML/RXML) is short and sweet, so you can see the structure of the output. Nitty-gritty details are best left to helper methods and partials, where they can be parametrized and used repeatedly.</p>
<p><span class="code"><strong>Note :</strong> We can call AJAX via 2 methods i.e 1) Using a button and 2) Normal Links. Then we can add the arguments through which we can achieve to have cool visual effects or perform serious AJAX operations. </span></p>
<p><strong>AJAX</strong> Helpers</p>
<ol>
<li><span class="code"><strong>button_to_function(button_value, *args, &amp;mp;block)</strong></span><br />
Returns a button that‘ll trigger a JavaScript function using the onclick handler. All of these go into the body tag of the view file. You can use the <span class="code">visual_effect</span> function to specify any visual effects</p>
<p><strong>Example : </strong><br />
This will show a button with the value &#8220;Greeting&#8221;, upon clicking will show a alert box with &#8220;Hello World!&#8221; inside.</p>
<pre lang="ruby">&lt;%=button_to_function "Greeting", "alert('Hello world!')" %&gt;</pre>
<p>This will display a button with value &#8220;Fade&#8221;, upon clicking will fade in or fade out the element &#8216;fade_text&#8217; (It can be a div element with id=fade_text).</p>
<pre lang="ruby">&lt;%=button_to_function "Fade", visual_effect(:toggle_appear, "fade_text", :duration =&gt; 0.5)%&gt;</pre>
</li>
<li><span class="code"><strong>link_to_function(name, *args, &amp;block) </strong></span><br />
Intead of a button, if you want to implement AJAX functionality using a text link. You can use this helper.<br />
Returns a link that will trigger a JavaScript function using the onclick handler and return false after the fact.</p>
<p><strong>Example : </strong><br />
This will show a &#8220;Greeting&#8221; link, upon clicking will show a alert box with &#8220;Hello World!&#8221; inside.</p>
<pre lang="ruby">&lt;%=link_to_function "Greeting", "alert('Hello world!')" %&gt;</pre>
<p>This will display a &#8220;Slide Me&#8221; link, upon clicking it will slide in or out the element &#8216;slide_text&#8217; (It can be a div element with id=slide_text).</p>
<pre lang="ruby">&lt;%=link_to_function "Slide Me", visual_effect(:toggle_slide, "slide_text", :duration =&gt; 0.5)%&gt;</pre>
</li>
<h4>Helper for Animation</h4>
<li><span class="code">visual_effect(name, element_id = false, js_options = {})</span><br />
Returns a JavaScript snippet to be used on the Ajax callbacks for starting visual effects.</p>
<p><strong>Example : </strong><br />
This will show a &#8220;Highlight&#8221; button, upon clicking will highlight the element which is specified.</p>
<pre lang="ruby">&lt;%=button_to_function "Highlight", visual_effect(:highlight, "element_id_name",:startcolor =&gt; '#ffff99', :endcolor =&gt; '#ffffff')%&gt;</pre>
<p>This will display a &#8220;Grow&#8221; link, upon clicking it will grow the specified element_id_name</p>
<pre lang="ruby">&lt;%= link_to_function "Grow", visual_effect(:grow,"element_id_name",:direction =&gt; "center",:duration =&gt; 1)%&gt;</pre>
</li>
</ol>
<p>I would really suggest to go through <a href="http://github.com/madrobby/scriptaculous/wikis">Script.aculo.us WIKI</a> to know more about every effect and their parameters. All of these effects can be used with RoR. For Example I have attached the code for the demo file.</p>
<h2>Code for the Demo File</h2>
<p><a href="http://www.visionmasterdesigns.com:12001/ajaxfunction" target="_blank">View Demo</a></p>
<pre class="brush: ruby">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;AJAX&lt;/title&gt;
&lt;%= javascript_include_tag  :defaults %&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;%=button_to_function &quot;Greeting Alert Me&quot;, &quot;alert(&#039;Hello world!&#039;)&quot; %&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h4&gt;Actions with paragraph using buttons&lt;/h4&gt;
&lt;%=button_to_function &quot;Fade&quot;, visual_effect(:toggle_appear, &quot;fade&quot;, :duration =&gt; 0.5)%&gt;
&lt;%=button_to_function &quot;Slide&quot;, visual_effect(:toggle_slide, &quot;fade&quot;,:duration =&gt; 1)%&gt;
&lt;%=button_to_function &quot;Highlight&quot;, visual_effect(:highlight, &quot;fade&quot;,:startcolor =&gt; &#039;#ffff99&#039;, :endcolor =&gt; &#039;#ffffff&#039;)%&gt;

&lt;div id=&quot;fade&quot; style=&quot;border:1px solid #dbdbdb; margin:50px;&quot;&gt;
This is test, This is test&lt;br&gt;
This is testing....&lt;br&gt;
Lorum ipsum blablasadadada
&lt;/div&gt;

&lt;h4&gt;Actions with Green Box using links&lt;/h4&gt;
&lt;%= link_to_function &quot;Toggle Fade&quot;, visual_effect(:toggle_appear, &quot;s1&quot;, :duration =&gt; 0.5)%&gt; ||
&lt;!-- Transitions --&gt;&lt;%= link_to_function &quot;Fade with wobble&quot;,&quot;new Effect.Fade(&#039;s1&#039;, { transition: Effect.Transitions.wobble })&quot; %&gt; ||
&lt;!-- grow effect --&gt;&lt;%= link_to_function &quot;Grow&quot;, visual_effect(:grow,&quot;s1&quot;,:direction =&gt; &quot;center&quot;,:duration =&gt; 1)%&gt; ||
&lt;!-- shake effect --&gt;&lt;%= link_to_function &quot;Shake&quot;, visual_effect(:shake,&quot;s1&quot;,:distance =&gt; &quot;30&quot;,:duration =&gt; 1)%&gt; ||
&lt;!-- morph effect --&gt;&lt;%= link_to_function &quot;Morph to Red box&quot;, visual_effect(:morph,&quot;s1&quot;,:style =&gt; &quot;{background: &#039;#f00&#039;,color: &#039;#fff&#039;,width: &#039;200px&#039;}&quot; )%&gt; ||
&lt;br&gt;
&lt;br&gt;
&lt;div id=&quot;s1&quot; style=&quot;width:80px; height:80px; cursor:move; background:#88da5d; border:1px solid #444; text-align:center;&quot;&gt;
&lt;/div&gt;

&lt;h4&gt;Drag Action with Blue Box&lt;/h4&gt;
&lt;div id=&quot;s2&quot; style=&quot;width:80px; height:80px; cursor:move; background:#7baaed; border:1px solid #333; text-align:center;&quot;&gt;
&lt;%= draggable_element(&quot;s2&quot;, :revert =&gt; true) %&gt;
DRAG ME
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h4>Related Articles</h4>
<p><a href="http://www.visionmasterdesigns.com/2008/07/tutorial-installing-ruby-on-rails-2-in-windows-vista-xp/">Tutorial : Installing Ruby on Rails 2 in Windows Vista/XP</a><br />
<a href="http://www.visionmasterdesigns.com/2008/07/tutorial-developing-your-first-ruby-on-rails-2-application/">Tutorial : Developing your First Ruby on Rails 2 Application</a><br />
<a href="http://www.visionmasterdesigns.com/2008/08/tutorial-basics-ruby-on-rails-2-model-controller-view-routing/">Tutorial : Basics on Ruby on Rails 2 Model, Controller and Views and Routing</a><br />
<a href="http://www.visionmasterdesigns.com/2008/08/tutorial-create-blog-using-ruby-on-rails-2-relationship/">Tutorial : Create a blog using Ruby on Rails 2. (Part 1 &#8211; Relationships)</a><br />
<a href="http://www.visionmasterdesigns.com/2008/09/tutorial-create-a-login-system-in-ruby-on-rails/">Tutorial : Create a login system in Ruby on Rails</a></p>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/tutorial-introduction-to-ajax-in-ruby-on-rails-with-prototype-scriptaculous/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tutorial : AJAX interface/menu using jQuery/PHP</title>
		<link>http://visionmasterdesigns.com/tutorial-ajax-interface-menu-using-jqueryphp/</link>
		<comments>http://visionmasterdesigns.com/tutorial-ajax-interface-menu-using-jqueryphp/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 15:24:34 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.visionmasterdesigns.com/?p=218</guid>
		<description><![CDATA[Hello Guys, I have been busy with college lately, since this is my last year in college, I need to do a very cool project to get some good marks . Anyways that doesn`t mean I won`t be postin tutorials here . Want to present your data using AJAX/PHP/MySQL by just coding few lines ? [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-ajax-interface-menu-using-jqueryphp%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Ftutorial-ajax-interface-menu-using-jqueryphp%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: center;"><a title="Ajax Interface" rel="lightbox[pics218]" href="http://www.visionmasterdesigns.com/blog/wp-content/uploads/2008/07/t1.jpg"><img class="attachment wp-att-219 centered" src="http://www.visionmasterdesigns.com/blog/wp-content/uploads/2008/07/t1.thumbnail.jpg" alt="Ajax Interface" width="350" height="180" /></a></p>
<p>Hello Guys,</p>
<p>I have been busy with college lately, since this is my last year in college, I need to do a very cool project to get some good marks <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Anyways that doesn`t mean I won`t be postin tutorials here <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Want to present your data using AJAX/PHP/MySQL by just coding few lines ? Well here it is. This tutorial teaches you how to present data using AJAX (using jQuery) with some neat effects. We can use PHP/MySQL to store the data and call it. In this tutorial I`ll teach you how to do so with PHP. So lets begin !</p>
<p>You can check the demo <a href="http://visionmasterdesigns.com/demo/ajaxinterface/" target="_blank">HERE</a>.<br />
You can download these files <a href="http://visionmasterdesigns.com/demo/ajaxinterface/interface.zip">HERE</a></p>
<h4>Index</h4>
<ol>
<li>Create the HTML page &#8211; <span class="code">index.html</span></li>
<li>
<ul>
<li><a href="http://www.visionmasterdesigns.com/2008/07/tutorial-ajax-interface-menu-using-jqueryphp/#css">The CSS</a></li>
<li><a href="http://www.visionmasterdesigns.com/2008/07/tutorial-ajax-interface-menu-using-jqueryphp/#html">The HTML</a></li>
<li><a href="http://www.visionmasterdesigns.com/2008/07/tutorial-ajax-interface-menu-using-jqueryphp/#javascript">The Javascript</a></li>
<li><a href="http://www.visionmasterdesigns.com/2008/07/tutorial-ajax-interface-menu-using-jqueryphp/#interface">Final interface.html page</a></li>
</ul>
</li>
<li>Create the PHP File &#8211; <span class="code">boo.php</span></li>
</ol>
<p><span id="more-218"></span></p>
<h2 align="center">HTML Page</h2>
<p>Our HTML file will contain the javascript as well as the CSS styles embedded within it. We can also create the effect by creating individual files for each i.e one for javascript functions and the other for the CSS. Anyways in this tutorial, both of them will be embedded within the html page. Now First fire up your favourite HTML editor (Personally I love Dreamweaver CS3).</p>
<p>We will be using The jQuery Framework &#8211; <span class="code">jquery.js</span>. If you want to know how the jQuery Framework works then do visit <a href="http://www.visionmasterdesigns.com/blog/2008/07/exploring-javascript-frameworks-jquery-126/">Exploring Javascript Frameworks : jQuery 1.2.6</a>.<br />
<!--adman--></p>
<h4><a name="css"></a>Step 1 &#8211; The CSS</h4>
<p>Lets add our css first. First create a new HTML file, call it <span class="code">interface.html</span>.<br />
The following is the css code.</p>
<pre class="brush: css">
&lt;style type=&quot;text/css&quot;&gt;
body { margin:0 auto 0 auto; color:#000; font-family:Georgia, &quot;Times New Roman&quot;, Times, serif; font-size:16px; background-color:#666666; }

.page { margin:100px auto 0 auto; width:750px;}

/*MENU START*/
#menu  { list-style:none; margin:0px; padding:0px;}

#menu li { list-style:none; display:inline; }
li.active a { background-color:#FFF;color:#000; }

#menu li a,#menu li a:link { float:left; background-color:#3c3c3c; margin-right:5px; padding:7px; color:#FFFFFF; text-decoration:none; width:6em; text-align:center;}
#menu li a:visited { }
#menu li a:hover { background-color:#327cc8 }
#menu li a:active { background-color:#FFF;color:#000; }
/* MENU END*/

#outcontent {clear:both; background-color:#FFFFFF; }
.content {background-color:#FFF; padding:10px; height:300px; margin:0px; }

#loading { clear:both; background:url(wait.gif) center top no-repeat; text-align:center;padding:33px 0px 0px 0px; font-size:12px;display:none; font-family:Verdana, Arial, Helvetica, sans-serif; }
&lt;/style&gt;
</pre>
<p>The CSS is pretty straight forward.</p>
<ul>
<li><span class="code">#page</span> will be assigned to a div, which will hold our menu and other divs
<li><span class="code">#menu</span> is the CSS to display our menu tabs.</li>
<li><span class="code">#loading</span> is the CSS to display the AJAX loading image.</li>
<li><span class="code">#outcontent</span> is the container to contain <span class="code">.content</span></li>
</ul>
<p>Put the above code inside the <span class="code">HEAD</span> tag of <span class="code">interface.html</span>. So <span class="code">interface.html</span> will look something like the following.</p>
<pre class="brush: html">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;interface.html&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
body { margin:0 auto 0 auto; color:#000; font-family:Georgia, &quot;Times New Roman&quot;, Times, serif; font-size:16px; background-color:#666666; }

.page { margin:100px auto 0 auto; width:750px;}

#menu  { list-style:none; margin:0px; padding:0px;}

#menu li { list-style:none; display:inline; }
li.active a { background-color:#FFF;color:#000; }

#menu li a,#menu li a:link { float:left; background-color:#3c3c3c; margin-right:5px; padding:7px; color:#FFFFFF; text-decoration:none; width:6em; text-align:center;}
#menu li a:visited { }
#menu li a:hover { background-color:#327cc8 }
#menu li a:active { background-color:#FFF;color:#000; }

.content {
background-color:#FFF; background:url(ajaxinterface.jpg) bottom right no-repeat; padding:10px; height:300px; margin:0px; }

#loading { clear:both; background:url(wait.gif) center top no-repeat; text-align:center;padding:33px 0px 0px 0px; font-size:12px;display:none; font-family:Verdana, Arial, Helvetica, sans-serif; }

#outcontent {clear:both; background-color:#FFFFFF; }

&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The above is the HTML page <span class="code">interface.html</span> with the CSS defined in it.</p>
<h4><a name="html"></a>Step 2 &#8211; The HTML</h4>
<p>Ok! Since now we have coded the CSS, lets create the HTML divs inside <span class="code">interface.html</span>.</p>
<ol>
<li>Inside the <span class="code">BODY</span> tag lets create a div which will contain the menu and the subsequent divs.</li>
<pre class="brush: html">
&lt;body&gt;
    &lt;div class=&quot;page&quot;&gt;
    &lt;!-- Menu and other divs go here !--&gt;
    &lt;/div&gt;
&lt;/body&gt;
</pre>
<li>Then we`ll create the menu Tabs.</li>
<pre class="brush: html">
&lt;body&gt;
    &lt;div class=&quot;page&quot;&gt;
    &lt;ul id=&quot;menu&quot;&gt;
    &lt;!-- you can add more tabs as you wish !--&gt;
             &lt;li id=&quot;about&quot;	&gt;&lt;a href=&quot;#&quot; title=&quot;about&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
            &lt;li id=&quot;portfolio&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;portfolio&quot;&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
            &lt;li id=&quot;contact&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;contact&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;br style=&quot;clear:both;&quot; /&gt;
    &lt;/div&gt;
&lt;/body&gt;
</pre>
<li>Now we need a container to display our <span class="code">Loading</span> text and our <span class="code">content</span>, so we`ll create 2 divs and lets put these divs inside another div called <span class="code">outcontent</span>. The following is how it`ll look.</li>
<pre class="brush: html">
&lt;body&gt;
    &lt;div class=&quot;page&quot;&gt;
        &lt;div&gt;
            &lt;ul id=&quot;menu&quot;&gt;
            &lt;!-- you can add more tabs as you wish !--&gt;
                         &lt;li id=&quot;about&quot;	&gt;&lt;a href=&quot;#&quot; title=&quot;about&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
                        &lt;li id=&quot;portfolio&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;portfolio&quot;&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
                        &lt;li id=&quot;contact&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;contact&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
        &lt;br style=&quot;clear:both;&quot; /&gt;
        &lt;/div&gt;
        &lt;!-- #outcontent - Overall div containing Loading div &amp;amp;amp; content div !--&gt;
        &lt;div id=&quot;outcontent&quot;&gt;
           	 &lt;div id=&quot;loading&quot;&gt;LOADING&lt;/div&gt;
            &lt;div class=&quot;content&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
        &lt;!-- #outcontent end !--&gt;
    &lt;/div&gt;
&lt;/body&gt;
</pre>
</ol>
<p><span class="code">interface.html</span></p>
<pre class="brush: html">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;interface.html&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
body { margin:0 auto 0 auto; color:#000; font-family:Georgia, &quot;Times New Roman&quot;, Times, serif; font-size:16px; background-color:#666666; }

.page { margin:100px auto 0 auto; width:750px;}

#menu  { list-style:none; margin:0px; padding:0px;}

#menu li { list-style:none; display:inline; }
li.active a { background-color:#FFF;color:#000; }

#menu li a,#menu li a:link { float:left; background-color:#3c3c3c; margin-right:5px; padding:7px; color:#FFFFFF; text-decoration:none; width:6em; text-align:center;}
#menu li a:visited { }
#menu li a:hover { background-color:#327cc8 }
#menu li a:active { background-color:#FFF;color:#000; }

.content {
background-color:#FFF; padding:10px; height:300px; margin:0px; }

#loading { clear:both; background:url(wait.gif) center top no-repeat; text-align:center;padding:33px 0px 0px 0px; font-size:12px;display:none; font-family:Verdana, Arial, Helvetica, sans-serif; }

#outcontent {clear:both; background-color:#FFFFFF; }

&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div class=&quot;page&quot;&gt;
&lt;div&gt;
&lt;ul id=&quot;menu&quot;&gt;
             &lt;li id=&quot;about&quot;	&gt;&lt;a href=&quot;#&quot; title=&quot;about&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
            &lt;li id=&quot;portfolio&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;portfolio&quot;&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
            &lt;li id=&quot;contact&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;contact&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br style=&quot;clear:both;&quot; /&gt;
&lt;/div&gt;
&lt;div id=&quot;outcontent&quot;&gt;
&lt;div id=&quot;loading&quot;&gt;LOADING&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The page should look something like the following</p>
<p style="text-align: center;"><a href="http://www.visionmasterdesigns.com/blog/wp-content/uploads/2008/07/t2.jpg" rel="lightbox[pics218]" title="empty Interface.html"><img src="http://www.visionmasterdesigns.com/blog/wp-content/uploads/2008/07/t2.thumbnail.jpg" alt="empty Interface.html" width="425" height="305" class="attachment wp-att-229 centered" /></a></p>
<h4><a name="javascript"></a>Step 3 &#8211; Add the Javascript Magic !</h4>
<p>This page would do for static pages, but we are making an AJAX powered page ! Its time to add the magic.<br />
First if you have read the <a href="http://www.visionmasterdesigns.com/blog/2008/07/exploring-javascript-frameworks-jquery-126/">Exploring Javascript Frameworks : jQuery 1.2.6</a> post, it should not be a problem.</p>
<ol>
<li>First lets link to the jquery library</li>
<pre class="brush: javascript">
&lt;script src=&quot;jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
</pre>
<li>Next lets open the script tag again and add the following code. The following code is pretty explainatory. I have added a lot of comments to show what each and every line does.</li>
<pre class="brush: javascript">
&lt;script&gt;
  // When the document loads do everything inside here ...
     $(document).ready(function(){
	 $(&#039;.content&#039;).load(&#039;boo.php&#039;);	//by default initally load text from boo.php
         $(&#039;#menu a&#039;).click(function() { //start function when any link is clicked
		 				$(&quot;.content&quot;).slideUp(&quot;slow&quot;);
						 var content_show = $(this).attr(&quot;title&quot;); //retrieve title of link so we can compare with php file
							$.ajax({
							method: &quot;get&quot;,url: &quot;boo.php&quot;,data: &quot;page=&quot;+content_show,
							beforeSend: function(){$(&quot;#loading&quot;).show(&quot;fast&quot;);}, //show loading just when link is clicked
							complete: function(){ $(&quot;#loading&quot;).hide(&quot;fast&quot;);}, //stop showing loading when the process is complete
							success: function(html){ //so, if data is retrieved, store it in html
							$(&quot;.content&quot;).show(&quot;slow&quot;); //animation
							$(&quot;.content&quot;).html(html); //show the html inside .content div
					 }
				 }); //close $.ajax(
         }); //close click(
	 }); //close $(
&lt;/script&gt;
</pre>
</ol>
<p>Voila ! thats it.</p>
<h2><a name="interface"></a>Our Final interface.html page</h2>
<pre class="brush: javascript">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;interface.html&lt;/title&gt;
&lt;script src=&quot;jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;script&gt;
  // When the document loads do everything inside here ...
     $(document).ready(function(){
	 $(&#039;.content&#039;).load(&#039;boo.php&#039;);	//by default initally load text from boo.php
         $(&#039;#menu a&#039;).click(function() { //start function when any link is clicked
		 				$(&quot;.content&quot;).slideUp(&quot;slow&quot;);
						 var content_show = $(this).attr(&quot;title&quot;); //retrieve title of link so we can compare with php file
							$.ajax({
							method: &quot;get&quot;,url: &quot;boo.php&quot;,data: &quot;page=&quot;+content_show,
							beforeSend: function(){$(&quot;#loading&quot;).show(&quot;fast&quot;);}, //show loading just when link is clicked
							complete: function(){ $(&quot;#loading&quot;).hide(&quot;fast&quot;);}, //stop showing loading when the process is complete
							success: function(html){ //so, if data is retrieved, store it in html
							$(&quot;.content&quot;).show(&quot;slow&quot;); //animation
							$(&quot;.content&quot;).html(html); //show the html inside .content div
					 }
				 }); //close $.ajax(
         }); //close click(
	 }); //close $(
&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
body { margin:0 auto 0 auto; color:#000; font-family:Georgia, &quot;Times New Roman&quot;, Times, serif; font-size:16px; background-color:#666666; }

.page { margin:100px auto 0 auto; width:750px;}

#menu  { list-style:none; margin:0px; padding:0px;}

#menu li { list-style:none; display:inline; }
li.active a { background-color:#FFF;color:#000; }

#menu li a,#menu li a:link { float:left; background-color:#3c3c3c; margin-right:5px; padding:7px; color:#FFFFFF; text-decoration:none; width:6em; text-align:center;}
#menu li a:visited { }
#menu li a:hover { background-color:#327cc8 }
#menu li a:active { background-color:#FFF;color:#000; }

.content {
background-color:#FFF; padding:10px; height:300px; margin:0px; }

#loading { clear:both; background:url(wait.gif) center top no-repeat; text-align:center;padding:33px 0px 0px 0px; font-size:12px;display:none; font-family:Verdana, Arial, Helvetica, sans-serif; }

#outcontent {clear:both; background-color:#FFFFFF; }

&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div class=&quot;page&quot;&gt;
&lt;div&gt;
&lt;ul id=&quot;menu&quot;&gt;
             &lt;li id=&quot;about&quot;	&gt;&lt;a href=&quot;#&quot; title=&quot;about&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
            &lt;li id=&quot;portfolio&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;portfolio&quot;&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
            &lt;li id=&quot;contact&quot;&gt;&lt;a href=&quot;#&quot; title=&quot;contact&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br style=&quot;clear:both;&quot; /&gt;
&lt;/div&gt;
&lt;div id=&quot;outcontent&quot;&gt;
&lt;div id=&quot;loading&quot;&gt;LOADING&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/tutorial-ajax-interface-menu-using-jqueryphp/feed/</wfw:commentRss>
		<slash:comments>89</slash:comments>
		</item>
		<item>
		<title>Exploring Javascript Frameworks : jQuery 1.2.6</title>
		<link>http://visionmasterdesigns.com/exploring-javascript-frameworks-jquery-126/</link>
		<comments>http://visionmasterdesigns.com/exploring-javascript-frameworks-jquery-126/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 14:03:28 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://blog.visionmasterdesigns.com/?p=134</guid>
		<description><![CDATA[Always found Javascript boring, its time you start checking out the greener side of Javascript. This Article explores the Javascript Framework : jQuery.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 0 0 0.6em 0.6em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fvisionmasterdesigns.com%2Fexploring-javascript-frameworks-jquery-126%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fvisionmasterdesigns.com%2Fexploring-javascript-frameworks-jquery-126%2F&amp;source=rowoot&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Hey guys,</p>
<p>You might be wondering where the hell are the Rails Tuts ! But before that, some of you might have read the <a href="http://www.visionmasterdesigns.com/blog/2008/07/tutorial-introduction-ajax-with-php/">Tutorial : Introduction to AJAX with PHP</a>, if you think coding AJAX is tough, think again ! Recently I have been doing a lot of research about different javascript frameworks which will help me ease AJAX and I came across <strong>JQuery</strong> and <strong>Prototype</strong>. It seems they were very commonly used by lot of people. Not only that, these frameworks, besides just providing AJAX they have a lot of cool features. So I decided to explore them.</p>
<p>This post explores some neat tricks I could do using jQuery ! So read on guys if you wanna learn <img src='http://visionmasterdesigns.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>Index</h2>
<ul>
<li>Introduction</li>
<li><a href="http://www.visionmasterdesigns.com/blog/2008/07/exploring-javascript-frameworks-jquery-126/#jwhat">What is jQuery ?</a></li>
<li><a href="http://www.visionmasterdesigns.com/blog/2008/07/exploring-javascript-frameworks-jquery-126/#download">Download jQuery ?!</a></li>
<li><a href="http://www.visionmasterdesigns.com/blog/2008/07/exploring-javascript-frameworks-jquery-126/#play">Playing with jQuery ?!</a></li>
<li><a href="http://www.visionmasterdesigns.com/blog/2008/07/exploring-javascript-frameworks-jquery-126/#effects">jQuery Effects ! ?</a></li>
</ul>
<p><span id="more-134"></span><br />
<a name="what"></a></p>
<h2>What is jQuery ?</h2>
<p>Ok ! If you have read <a href="http://www.visionmasterdesigns.com/blog/2008/07/tutorial-introduction-ajax-with-php/">Tutorial : Introduction to AJAX with PHP</a>, you will notice what a pain it is to code using javascript. Imagine the same same function to be performed by writing just 5 lines&#8230;this is what jQuery can help us achieve.</p>
<p>It is a set of functions written in javascript, to make our life easier.<br />
For Example</p>
<pre class="brush: javascript">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Base page for content&lt;/title&gt;
&lt;script src=&quot;jquery-1.2.6.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
jQuery(function($) {
$(&quot;#contentArea&quot;).load(&quot;a.html&quot;);
});

//--&gt;
&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;contentArea&quot;&gt;&lt;!--loads contents of a.html here--&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The above javascript function will load the contents of a.html to our div with id=contentArea. Imagine doing the same with normal AJAX functions, it would take anything not less than 10 lines of code. Anyways lets see how can use jQuery to minimize our load.</p>
<p><a name="download"></a></p>
<h2>Download jQuery</h2>
<p>First lets download the javascript framework from <a href="http://jquery.com">jquery.com</a>. Since we plan to develop and do a lot testing, download the <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6.js">jQuery 1.2.6 (97kb, Uncompressed)</a>.</p>
<p>Download the jquery-1.2.6.js file and save it.</p>
<p>Everytime we want to use jQuery, we need to include the above script in our HTML files. You can do so as shown below i.e add <span class="code"><script src="jquery-1.2.6.js" type="text/javascript"></script></span> between the head tags.</p>
<pre class="brush: html">
 &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
 &lt;head&gt;
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
 &lt;title&gt;Untitled Document&lt;/title&gt;
 &lt;script src=&quot;jquery-1.2.6.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;/body&gt;
 &lt;/html&gt;
 </pre>
<p><a name="play"></a></p>
<h2>Playing with jQuery ?!</h2>
<p>Like I showed you in Page 2. 3 lines of code in javascript using jQuery can do stuff which is far more than 10 lines of code in javascript without jQuery.<br />
 Anyways I am going to show you some neat tricks you can do using jQuery. The basics ofcourse !</p>
<h4>The basic code</h4>
<p>Like I said, you need to include the basic javascript library file if you want to use jQuery features.</p>
<h4>ready function</h4>
<p>The following code shows jQuery equivalent code to the javascript function</p>
<pre class="brush: javascript">
 // normal javascript
 &lt;script type=&quot;text/javascript&quot;&gt;
 window.onload = function(){ alert(&quot;abc&quot;); }
 &lt;/script&gt;

// equivalent in jQuery
 &lt;script src=&quot;jquery-1.2.6.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;
 $(document).ready(function(){ alert(&quot;abc&quot;); });
 &lt;/script&gt;
 </pre>
<p> <strong>What it does : </strong><br />
 Both the code alert the user with a message box, having msg &#8220;abc&#8221;.</p>
<h4>click function</h4>
<pre class="brush: javascript">
 &lt;script type=&quot;text/javascript&quot;&gt;
 // normal javascript
 function clickme() {
 alert(&quot;abc&quot;);
 }
 &lt;/script&gt;
 &lt;a href=&quot;#&quot; onClick=&quot;clickme();&quot;&gt;Have to specify the function for links you want alert to show&lt;/a&gt;

&lt;script src=&quot;jquery-1.2.6.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;
 $(document).ready(function() {
 $(&quot;a&quot;).click(function () {	// When any link is clicked
 alert(&quot;abc&quot;); //alert user
 });
 });
 &lt;/script&gt;
 &lt;a href=&quot;#&quot;&gt;All the links will alert&lt;/a&gt;
 </pre>
<p> <strong>What it does : </strong></p>
<p><strong>Normal Javascript -</strong>Displays alert box, if a links is clicked. In normal javascript, we have to write a call to the clickme() function on every link to show alert box.<br />
 <strong>jQuery &#8211; </strong>All the links will show alert box on click since<br />
 <span class="code">$(&#8220;a&#8221;).click(function () {//function });</span> where &#8220;a&#8221; refers to all anchor tags.<br />
 If you want to specify any one particular tag, then<br />
 <span class="code">$(&#8220;a#1&#8243;).click(function () {//function });</span> where alert box will only be displayed when a link with id=1 is clicked.</p>
<h4>add class</h4>
<p><span class="code">$(&#8220;div#foo&#8221;).addClass(&#8220;test&#8221;);</span><br />
 The above code will add the class test to div with id=foo. You can add css styles using this piece of code.</p>
<h4>html code</h4>
<p><span class="code">$(&#8220;div#foo&#8221;).html(&#8220;Hello World&#8221;);</span><br />
 The above code, will update div with id=foo, with Hello World. This is more like<br />
 <span class="code">obj.innerHTML = &#8220;Hello World&#8221;</span> where<br />
 <span class="code">obj = document.getElement(&#8220;foo&#8221;);</span>.</p>
<p>For more information, I suggest you read this <a href="http://docs.jquery.com/Frequently_Asked_Questions">Frequently Asked Questions</a>.</p>
<p>Now lets move to the next page and create some effects !!</p>
<p><a name="effects"></a></p>
<h2>jQuery Effects ! ?</h2>
<p>Yup thats right, jQuery has some neat effects up its sleave.<br />
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script><br />
<script type="text/javascript"><!--
$(document).ready(function() {	
		//fade functions
		$("#fadein").click(function () {	// When any link is clicked		
		$("#fadeeffect").fadeIn("slow");
		});	
		$("#fadeout").click(function () {	// When any link is clicked		
		$("#fadeeffect").fadeOut("slow");
		});
		//slide functions
		$("#slidein").click(function () {	// When any link is clicked		
		$("#slideeffect").slideDown("slow");
		});	
		$("#slideout").click(function () {	// When any link is clicked		
		$("#slideeffect").slideUp("slow");
		});
		//custom animation
		$("#custom").click(function(){
    	$("#customtext").animate({ 
        width: "70%",
        opacity: 0.5,
        marginLeft: "0.6in",
        fontSize: "2em" 
        }, 1500 );
    });
	  });
// --></script></p>
<input id="fadein" name="fadein" type="button" value="Fade In" />
<input id="fadeout" name="fadeout" type="button" value="Fade Out" />
<div id="fadeeffect" style="border:1px solid #1a6780; display:none; margin:10px; background-color:#e3eff3;padding:10px;">FADING&#8230;<br />
Lorem epsom sied van heity rath mapark to ratham. Msgyht raspiem maks vem iey tor sto fo rtem leom. Marks maxi umlion tor pion skim quedrtem lorespiortium.</div>
<input id="slidein" name="slidein" type="button" value="Slide In" />
<input id="slideout" name="slideout" type="button" value="Slide Out" />
<div id="slideeffect" style="border:1px solid #1a6780; display:none; margin:10px; background-color:#e3eff3;padding:10px;">SLIDING&#8230;<br />
Lorem epsom sied van heity rath mapark to ratham. Msgyht raspiem maks vem iey tor sto fo rtem leom. Marks maxi umlion tor pion skim quedrtem lorespiortium.</div>
<p>The code for the above effects..</p>
<pre class="brush: javascript">
&lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
//fade functions
$(&quot;#fadein&quot;).click(function () {	// When any link is clicked
$(&quot;#fadeeffect&quot;).fadeIn(&quot;slow&quot;); //fade in effect
});
$(&quot;#fadeout&quot;).click(function () {	// When any link is clicked
$(&quot;#fadeeffect&quot;).fadeOut(&quot;slow&quot;); //fade out effect
});
//slide functions
$(&quot;#slidein&quot;).click(function () {	// When any link is clicked
$(&quot;#slideeffect&quot;).slideDown(&quot;slow&quot;); //slide in
});
$(&quot;#slideout&quot;).click(function () {	// When any link is clicked
$(&quot;#slideeffect&quot;).slideUp(&quot;slow&quot;); //slide out
});
});
&lt;/script&gt;
&lt;input type=&quot;button&quot; id=&quot;fadein&quot; name=&quot;fadein&quot; value=&quot;Fade In&quot; /&gt;
&lt;input type=&quot;button&quot; id=&quot;fadeout&quot; name=&quot;fadeout&quot; value=&quot;Fade Out&quot; /&gt;
&lt;div id=&quot;fadeeffect&quot; style=&quot;border:1px solid #1a6780; display:none; margin:10px;padding:10px; background-color:#e3eff3;&quot;&gt;
FADING...
Lorem epsom sied van heity rath mapark to ratham. Msgyht raspiem maks vem iey tor sto fo rtem leom. Marks maxi umlion tor pion skim quedrtem lorespiortium.
&lt;/div&gt;
&lt;input type=&quot;button&quot; id=&quot;slidein&quot; name=&quot;slidein&quot; value=&quot;Slide In&quot;  /&gt;
&lt;input type=&quot;button&quot; id=&quot;slideout&quot; name=&quot;slideout&quot; value=&quot;Slide Out&quot;  /&gt;
&lt;div id=&quot;slideeffect&quot; style=&quot;border:1px solid #1a6780; display:none; margin:10px; padding:10px; background-color:#e3eff3;&quot;&gt;
SLIDING...
Lorem epsom sied van heity rath mapark to ratham. Msgyht raspiem maks vem iey tor sto fo rtem leom. Marks maxi umlion tor pion skim quedrtem lorespiortium.
&lt;/div&gt;
</pre>
<p>Pretty cool huh ! just 3 lines of code and viola !<br />
jQuery also gives the ability to create a custom animation.</p>
<input id="custom" name="custom" type="button" value="Animate" />
<div id="customtext" style="border: 1px solid #1a6780; margin: 10px; padding: 5px; background-color: #e3eff3; width: 100px;">Animate</div>
<p>The code for the above is</p>
<pre class="brush: javascript">
&lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
//custom animation
$(&quot;#custom&quot;).click(function(){
$(&quot;#customtext&quot;).animate({
width: &quot;70%&quot;,
opacity: 0.5,
marginLeft: &quot;0.6in&quot;,
fontSize: &quot;2em&quot;,
}, 1500 );
});
&lt;/script&gt;
&lt;input type=&quot;button&quot; id=&quot;custom&quot; name=&quot;custom&quot; value=&quot;Animate&quot;  /&gt;
&lt;div id=&quot;customtext&quot; style=&quot;border:1px solid #1a6780; margin:10px; padding:5px; background-color:#e3eff3; width:100px;&quot;&gt;
Animate ME !
&lt;/div&gt;
</pre>
<p>You can read more documentation about these effects <a href="http://docs.jquery.com/Effects">http://docs.jquery.com/Effects</a>.</p>
<p>Well I have covered most of the usual functions people use with jQuery. Use your imagination to create stunning webpages. you can visit <a href="http://www.visionmasterdesigns.com">http://www.visionmasterdesigns.com</a> since it is jQuery powered.</p>
<p>But hold on guys ! Be sure to check out the next part where we will be exploring another famous javascript framework &#8220;<a href="http://www.prototypejs.org">Prototype</a>&#8220;.</p>
<p>Cya</p>
<div class="donate"><strong>Found this tutorial really useful, you can click here to donate.</strong></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_donations" />
<input name="business" type="hidden" value="rowoot@gmail.com" />
<input name="item_name" type="hidden" value="MICHEAL BENEDICT ARUL" />
<input name="no_shipping" type="hidden" value="0" />
<input name="no_note" type="hidden" value="1" />
<input name="currency_code" type="hidden" value="USD" />
<input name="tax" type="hidden" value="0" />
<input name="lc" type="hidden" value="IN" />
<input name="bn" type="hidden" value="PP-DonationsBF" />
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" type="image" /> <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" border="0" alt="" width="1" height="1" /><br />
</form>
</div>
]]></content:encoded>
			<wfw:commentRss>http://visionmasterdesigns.com/exploring-javascript-frameworks-jquery-126/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
