<?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>The Tutorial Blog &#187; javascript</title>
	<atom:link href="http://www.thetutorialblog.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetutorialblog.com</link>
	<description></description>
	<lastBuildDate>Wed, 07 Jul 2010 23:30:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<image>
<link>http://www.thetutorialblog.com</link>
<url>http://www.thetutorialblog.com/wp-content/plugins/maxblogpress-favicon/icons/favicon-28.ico</url>
<title>The Tutorial Blog</title>
</image>
		<item>
		<title>Deep Linking with jQuery</title>
		<link>http://www.thetutorialblog.com/jquery/deep-linking-with-jquery/</link>
		<comments>http://www.thetutorialblog.com/jquery/deep-linking-with-jquery/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 14:43:43 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[deep linking]]></category>
		<category><![CDATA[deep linking tutorial]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery help]]></category>
		<category><![CDATA[jquery tutorial]]></category>
		<category><![CDATA[the tutorial blog]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[wez pyke]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=243</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	You can view a demo and download the resources for this tutorial at the bottom of the post. Web 2.0 websites have a lot of Ajax functionality, some times when you load a new element of a page you may want the user to be able to click the back or forward button so that [...]


Related posts:<ol><li><a href='http://www.thetutorialblog.com/php/build-a-twitter-like-site-with-codeigniter-and-jquery-part-2/' rel='bookmark' title='Permanent Link: Build a Twitter-like site with CodeIgniter and jQuery Part 2'>Build a Twitter-like site with CodeIgniter and jQuery Part 2</a> <small>Don't forget to check out part 1 if you have...</small></li>
<li><a href='http://www.thetutorialblog.com/php/build-a-twitter-like-site-with-codeigniter-and-jquery/' rel='bookmark' title='Permanent Link: Build a Twitter-like site with CodeIgniter and jQuery'>Build a Twitter-like site with CodeIgniter and jQuery</a> <small>This tutorial will be the first of a five part...</small></li>
<li><a href='http://www.thetutorialblog.com/php/php-gallery-with-no-page-reloads-using-jquery/' rel='bookmark' title='Permanent Link: PHP gallery with no page reloads using jQuery'>PHP gallery with no page reloads using jQuery</a> <small>For this tutorial we will be using the ImgBrowz0r class...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fjquery%2Fdeep-linking-with-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fjquery%2Fdeep-linking-with-jquery%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Deep Linking with jQuery" alt=" Deep Linking with jQuery" /><br />
			</a>
		</div>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/Screen-shot-2010-02-10-at-14.52.00.png" alt="jQuery" title="jQuery" width="263" height="79" class="alignleft size-full wp-image-251" /></p>
<p><em>You can view a demo and download the resources for this tutorial at the bottom of the post.</em></p>
<p>Web 2.0 websites have a lot of Ajax functionality, some times when you load a new element of a page you may want the user to be able to click the back or forward button so that they can see the previously loaded content. One method to add this function to a website is to use the <a href="http://www.asual.com/jquery/address/">jQuery Address</a> plugin with jQuery. </p>
<p><a href="http://www.asual.com/jquery/address/">jQuery Addres</a>s has 4 main <a href="http://www.asual.com/jquery/address/docs/">methods</a>; <strong>init</strong>, <strong>change</strong>, <strong>internalChange</strong>, <strong>externalChange</strong>. The <strong>init</strong> method is what is called when the plugin is initiated. The <strong>change</strong> method is called when the URL is changed, an element in the page is changed or either the forward or backward button is pressed. The change method has the combined functionality of <strong>internalChange</strong> and <strong>externalChange</strong>. The <strong>internalChange</strong> is only called when a hyperlink inside the page is clicked; <strong>externalChange</strong> is only called when the URL is changed or the backward or forward button is pressed. </p>
<p>To allow deep linking within your website the only two methods that are required is <strong>init</strong> and <strong>change</strong>, you can then use <strong>internalChange</strong> and <strong>externalChange</strong> wherever you may need them. <br />
<span id="more-243"></span></p>
<h2>Getting it to work</h2>
<p>The first thing that is required of course is that you download the file for <a href="http://www.asual.com/jquery/address/">jQuery Address</a>. When you have done this copy the <em>jquery.address-1.1.min.js</em> file into the same location as your index.html file. </p>
<p>Now we include jQuery and the jQuery Address plugin, put this inside the head tags in your html file:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script src=&quot;http://www.google.com/jsapi&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
google.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;jquery&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;1.4.1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;script src=&quot;jquery.address-1.1.min.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<h2>The jQuery</h2>
<p>The next thing that we're going to do is create a function that will be called when a hyperlink is clicked so that we know what file to load and where to load it. We will call this function <strong>loadURL()</strong>, it will take one parameter named url.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> loadURL<span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    	console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;loadURL: &quot;</span> <span style="color: #339933;">+</span> url<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#area&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>We have console.log so that when we open up Firebug in Firefox we know which page is being requested. This is useful for debugging if there are any faults with the requested page loading. </p>
<p>We now set the jQuery Address event handlers so we know when to deep link an element within the page.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">address</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	        console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;init: &quot;</span> <span style="color: #339933;">+</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[rel=address:'</span> <span style="color: #339933;">+</span> event.<span style="color: #660066;">value</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">']'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#area&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[rel=address:'</span> <span style="color: #339933;">+</span> event.<span style="color: #660066;">value</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">']'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    	console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;change&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>What this code does is retrieves the href attribute from a hyperlink by matching the rel to a hyperlink. We also log when it should have changed so we can see this in Firebug.</p>
<p>The last bit of jQuery that we do will check when a link has been pressed and then call the <strong>loadURL()</strong> function that we created before.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	    	loadURL<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This is what the head of your file should look like:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&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;TheTutorialBlog.com : jQuery Deep Linking&lt;/title&gt;
	&lt;script src=&quot;http://www.google.com/jsapi&quot;&gt;&lt;/script&gt;
	<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	google.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;jquery&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;1.4.1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
	&lt;script src=&quot;jquery.address-1.1.min.js&quot;&gt;&lt;/script&gt;
&nbsp;
&nbsp;
	<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #009966; font-style: italic;">/*&lt;![CDATA[*/</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;document&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	    <span style="color: #003366; font-weight: bold;">function</span> loadURL<span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    	console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;loadURL: &quot;</span> <span style="color: #339933;">+</span> url<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#area&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
	    <span style="color: #006600; font-style: italic;">// Event handlers</span>
	    $.<span style="color: #660066;">address</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	        console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;init: &quot;</span> <span style="color: #339933;">+</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[rel=address:'</span> <span style="color: #339933;">+</span> event.<span style="color: #660066;">value</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">']'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#area&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[rel=address:'</span> <span style="color: #339933;">+</span> event.<span style="color: #660066;">value</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">']'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    	console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;change&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
&nbsp;
	    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	    	loadURL<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009966; font-style: italic;">/*]]&gt;*/</span>
	<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/head&gt;</pre></div></div>

<h2>The HTML</h2>
<p>The HTML for this is really basic stuff, we will create two hyperlinks that will load two separate files. We will also create a div element named area, this is where the files will be loaded.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;body&gt;
&nbsp;
&nbsp;
	&lt;a href=&quot;test1.html&quot; rel=&quot;address:/test1&quot;&gt;Test 1&lt;/a&gt; &lt;br /&gt;
	&lt;a href=&quot;test2.html&quot; rel=&quot;address:/test2&quot;&gt;Test 2&lt;/a&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;
&nbsp;
	Load Area: &lt;br /&gt;
	&lt;div id=&quot;area&quot;&gt;&lt;/div&gt;
&nbsp;
&nbsp;
&lt;/body&gt;</pre></div></div>

<p>The name of the file that you want to load goes inside the <strong>href</strong> tag. You also need to include <em>address:/</em> inside <strong>rel</strong>. This is how jQuery Address knows what hyperlinks you want to deep link.</p>
<h2>Final words</h2>
<p>I hope this tutorial has been useful, please feel free to leave a comment or ReTweet this tutorial on Twitter.</p>
<h2>Demo and Download</h2>
<p><a href="http://bit.ly/aU5vcT">Demo</a><br />
<a href="http://bit.ly/c95Qwa">Download</a></p>


<p>Related posts:<ol><li><a href='http://www.thetutorialblog.com/php/build-a-twitter-like-site-with-codeigniter-and-jquery-part-2/' rel='bookmark' title='Permanent Link: Build a Twitter-like site with CodeIgniter and jQuery Part 2'>Build a Twitter-like site with CodeIgniter and jQuery Part 2</a> <small>Don't forget to check out part 1 if you have...</small></li>
<li><a href='http://www.thetutorialblog.com/php/build-a-twitter-like-site-with-codeigniter-and-jquery/' rel='bookmark' title='Permanent Link: Build a Twitter-like site with CodeIgniter and jQuery'>Build a Twitter-like site with CodeIgniter and jQuery</a> <small>This tutorial will be the first of a five part...</small></li>
<li><a href='http://www.thetutorialblog.com/php/php-gallery-with-no-page-reloads-using-jquery/' rel='bookmark' title='Permanent Link: PHP gallery with no page reloads using jQuery'>PHP gallery with no page reloads using jQuery</a> <small>For this tutorial we will be using the ImgBrowz0r class...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/jquery/deep-linking-with-jquery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Easily and effectively display images with FancyBox</title>
		<link>http://www.thetutorialblog.com/general/easily-and-effectively-display-images-with-fancybox/</link>
		<comments>http://www.thetutorialblog.com/general/easily-and-effectively-display-images-with-fancybox/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 23:32:39 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Text Tutorials]]></category>
		<category><![CDATA[alternative]]></category>
		<category><![CDATA[fancybox]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=117</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	FancyBox is a plugin for jQuery that allows you to easily display images in the same window with a simple yet effective code. The plugin takes no time to set up and all that is required is that you include the jQuery javascript library within the pages that you are using the FancyBox plugin on. [...]


Related posts:<ol><li><a href='http://www.thetutorialblog.com/text-tutorials/quick-tip-resolving-conflicting-problems-between-jquery-and-mootools-or-any-other-javascript-library/' rel='bookmark' title='Permanent Link: Quick Tip: Resolving conflicting problems between jQuery and MooTools or any other Javascript library'>Quick Tip: Resolving conflicting problems between jQuery and MooTools or any other Javascript library</a> <small>Recently I wrote quite a huge chunk of jQuery for...</small></li>
<li><a href='http://www.thetutorialblog.com/jquery/deep-linking-with-jquery/' rel='bookmark' title='Permanent Link: Deep Linking with jQuery'>Deep Linking with jQuery</a> <small>You can view a demo and download the resources for...</small></li>
<li><a href='http://www.thetutorialblog.com/php/php-gallery-with-no-page-reloads-using-jquery/' rel='bookmark' title='Permanent Link: PHP gallery with no page reloads using jQuery'>PHP gallery with no page reloads using jQuery</a> <small>For this tutorial we will be using the ImgBrowz0r class...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fgeneral%2Feasily-and-effectively-display-images-with-fancybox%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fgeneral%2Feasily-and-effectively-display-images-with-fancybox%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Easily and effectively display images with FancyBox" alt=" Easily and effectively display images with FancyBox" /><br />
			</a>
		</div>
<p><img class="alignleft size-full wp-image-118" title="fancybox" src="http://www.thetutorialblog.com/wp-content/uploads/2009/08/fancybox.png" alt="fancybox Easily and effectively display images with FancyBox" width="343" height="103" /><a href="http://fancybox.net/">FancyBox</a> is a plugin for <a href="http://www.jquery.com">jQuery</a> that allows you to easily display images in the same window with a simple yet effective code. The plugin takes no time to set up and all that is required is that you include the jQuery javascript library within the pages that you are using the FancyBox plugin on.</p>
<p>Features:</p>
<ul>
<li>Display single images</li>
<li>Create image galleries</li>
<li>Display iFrame</li>
<li>Execute Ajax</li>
<li>Include Flash, movies or audio files</li>
</ul>
<h2>Using FancyBox</h2>
<p>First of all we need to link to the jQuery and FancyBox file after we have downloaded.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;path-to-file/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;path-to-file/jquery.fancybox.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p><span id="more-117"></span><br />
Next we add the stylesheet that is included with FancyBox:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;path-to-file/fancybox.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;&gt;</pre></div></div>

<p>Then to link to an image we simply set the id of an image to "<i>single_image</i>":</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a id=&quot;single_image&quot; href=&quot;image_big.jpg&quot;&gt;&lt;img src=&quot;image_small.jpg&quot; alt=&quot;&quot;/&gt;&lt;/a&gt;</pre></div></div>

<p>All that is left to do is execute the jQuery code when the DOM is loaded.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#single_image&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fancybox</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That is all the code that is needed to display a single image. To learn how to do things such as ajax calls, view the documentation for FancyBox <a href="http://fancybox.net/howto">here</a>.</p>
<h2>Other lightbox alternatives</h2>
<p>Is there another lightbox alternative that you have used that you would like to share with all the readers? Post a comment below.</p>


<p>Related posts:<ol><li><a href='http://www.thetutorialblog.com/text-tutorials/quick-tip-resolving-conflicting-problems-between-jquery-and-mootools-or-any-other-javascript-library/' rel='bookmark' title='Permanent Link: Quick Tip: Resolving conflicting problems between jQuery and MooTools or any other Javascript library'>Quick Tip: Resolving conflicting problems between jQuery and MooTools or any other Javascript library</a> <small>Recently I wrote quite a huge chunk of jQuery for...</small></li>
<li><a href='http://www.thetutorialblog.com/jquery/deep-linking-with-jquery/' rel='bookmark' title='Permanent Link: Deep Linking with jQuery'>Deep Linking with jQuery</a> <small>You can view a demo and download the resources for...</small></li>
<li><a href='http://www.thetutorialblog.com/php/php-gallery-with-no-page-reloads-using-jquery/' rel='bookmark' title='Permanent Link: PHP gallery with no page reloads using jQuery'>PHP gallery with no page reloads using jQuery</a> <small>For this tutorial we will be using the ImgBrowz0r class...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/general/easily-and-effectively-display-images-with-fancybox/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery Form Validation</title>
		<link>http://www.thetutorialblog.com/video-tutorials/jquery-form-validation/</link>
		<comments>http://www.thetutorialblog.com/video-tutorials/jquery-form-validation/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 20:38:47 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[Video Tutorials]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=82</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	Create a form that requires the user to enter both a username and password. If the username field or password field is left blank then a message will be displayed. Related posts:Build a Twitter-like site with CodeIgniter and jQuery Part 2 Don't forget to check out part 1 if you have... jQuery Dropdown Suggestions For [...]


Related posts:<ol><li><a href='http://www.thetutorialblog.com/php/build-a-twitter-like-site-with-codeigniter-and-jquery-part-2/' rel='bookmark' title='Permanent Link: Build a Twitter-like site with CodeIgniter and jQuery Part 2'>Build a Twitter-like site with CodeIgniter and jQuery Part 2</a> <small>Don't forget to check out part 1 if you have...</small></li>
<li><a href='http://www.thetutorialblog.com/jquery/jquery-dropdown-suggestions/' rel='bookmark' title='Permanent Link: jQuery Dropdown Suggestions'>jQuery Dropdown Suggestions</a> <small>For this tutorial we are going to create a drop...</small></li>
<li><a href='http://www.thetutorialblog.com/php/adding-security-to-codeigniter-forms-with-a-custom-library-class/' rel='bookmark' title='Permanent Link: Adding security to CodeIgniter forms with a custom library class'>Adding security to CodeIgniter forms with a custom library class</a> <small>The class that we are going to create within CI...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fvideo-tutorials%2Fjquery-form-validation%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fvideo-tutorials%2Fjquery-form-validation%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="jQuery Form Validation" alt=" jQuery Form Validation" /><br />
			</a>
		</div>
<p>Create a form that requires the user to enter both a username and password. If the username field or password field is left blank then a message will be displayed.</p>
<p><object type="application/x-shockwave-flash" width="512" height="399" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" ><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf" /><param name="flashvars" value="init=http://blip.tv/play/AYGN4GwA" /><embed src="http://blip.tv/play/AYGN4GwA" type="application/x-shockwave-flash" width="512" height="399" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>


<p>Related posts:<ol><li><a href='http://www.thetutorialblog.com/php/build-a-twitter-like-site-with-codeigniter-and-jquery-part-2/' rel='bookmark' title='Permanent Link: Build a Twitter-like site with CodeIgniter and jQuery Part 2'>Build a Twitter-like site with CodeIgniter and jQuery Part 2</a> <small>Don't forget to check out part 1 if you have...</small></li>
<li><a href='http://www.thetutorialblog.com/jquery/jquery-dropdown-suggestions/' rel='bookmark' title='Permanent Link: jQuery Dropdown Suggestions'>jQuery Dropdown Suggestions</a> <small>For this tutorial we are going to create a drop...</small></li>
<li><a href='http://www.thetutorialblog.com/php/adding-security-to-codeigniter-forms-with-a-custom-library-class/' rel='bookmark' title='Permanent Link: Adding security to CodeIgniter forms with a custom library class'>Adding security to CodeIgniter forms with a custom library class</a> <small>The class that we are going to create within CI...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/video-tutorials/jquery-form-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery #1</title>
		<link>http://www.thetutorialblog.com/video-tutorials/jquery-1/</link>
		<comments>http://www.thetutorialblog.com/video-tutorials/jquery-1/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 22:45:40 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[Video Tutorials]]></category>
		<category><![CDATA[animate]]></category>
		<category><![CDATA[blip]]></category>
		<category><![CDATA[blip.tv]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=73</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	Learn how to use the animate function within the jQuery library to create an effect similar to the table of contents for the table of contents on codeigniter.com. Blip.tv Link Click to play Related posts:Deep Linking with jQuery You can view a demo and download the resources for... Build a Twitter-like site with CodeIgniter and [...]


Related posts:<ol><li><a href='http://www.thetutorialblog.com/jquery/deep-linking-with-jquery/' rel='bookmark' title='Permanent Link: Deep Linking with jQuery'>Deep Linking with jQuery</a> <small>You can view a demo and download the resources for...</small></li>
<li><a href='http://www.thetutorialblog.com/php/build-a-twitter-like-site-with-codeigniter-and-jquery/' rel='bookmark' title='Permanent Link: Build a Twitter-like site with CodeIgniter and jQuery'>Build a Twitter-like site with CodeIgniter and jQuery</a> <small>This tutorial will be the first of a five part...</small></li>
<li><a href='http://www.thetutorialblog.com/jquery/10-awesome-jquery-tutorials-you-should-check-out/' rel='bookmark' title='Permanent Link: 10 Awesome jQuery Tutorials You Should Check Out'>10 Awesome jQuery Tutorials You Should Check Out</a> <small>jQuery is a great tool that everyone in web development...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fvideo-tutorials%2Fjquery-1%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fvideo-tutorials%2Fjquery-1%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="jQuery #1" alt=" jQuery #1" /><br />
			</a>
		</div>
<p>Learn how to use the animate function within the jQuery library to create an effect similar to the table of contents for the table of contents on codeigniter.com. </p>
<p><a href="http://thetutorialblog.blip.tv/file/2296444/">Blip.tv Link</a></p>
<p><span id="more-73"></span></p>
<p><center>															<script type="text/javascript" src="http://blip.tv/scripts/pokkariPlayer.js?ver=2008010901"></script>					<script type="text/javascript" src="http://blip.tv/syndication/write_player?skin=js&#038;posts_id=2312660&#038;source=3&#038;autoplay=true&#038;file_type=flv&#038;player_width=1024&#038;player_height=768"></script>
<div id="blip_movie_content_2312660">					<a rel="enclosure" href="http://blip.tv/file/get/Thetutorialblog-jQuery1834.flv" onclick="play_blip_movie_2312660(); return false;"><img title="Click to play" alt="Video thumbnail. Click to play" width="512" height="384" src="http://blip.tv/file/get/Thetutorialblog-jQuery1834.flv.jpg" border="0" title="Click to play" /></a>					<br />					<a rel="enclosure" href="http://blip.tv/file/get/Thetutorialblog-jQuery1834.flv" onclick="play_blip_movie_2312660(); return false;">Click to play</a>					</div>
<p>										</center></p>


<p>Related posts:<ol><li><a href='http://www.thetutorialblog.com/jquery/deep-linking-with-jquery/' rel='bookmark' title='Permanent Link: Deep Linking with jQuery'>Deep Linking with jQuery</a> <small>You can view a demo and download the resources for...</small></li>
<li><a href='http://www.thetutorialblog.com/php/build-a-twitter-like-site-with-codeigniter-and-jquery/' rel='bookmark' title='Permanent Link: Build a Twitter-like site with CodeIgniter and jQuery'>Build a Twitter-like site with CodeIgniter and jQuery</a> <small>This tutorial will be the first of a five part...</small></li>
<li><a href='http://www.thetutorialblog.com/jquery/10-awesome-jquery-tutorials-you-should-check-out/' rel='bookmark' title='Permanent Link: 10 Awesome jQuery Tutorials You Should Check Out'>10 Awesome jQuery Tutorials You Should Check Out</a> <small>jQuery is a great tool that everyone in web development...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/video-tutorials/jquery-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://blip.tv/file/get/Thetutorialblog-jQuery1652.mov" length="34276983" type="video/quicktime" />
<enclosure url="http://blip.tv/file/get/Thetutorialblog-jQuery1834.flv" length="32154787" type="video/x-flv" />
		</item>
	</channel>
</rss>
