<?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>Theme Heven &#187; Jquery</title>
	<atom:link href="http://www.themeheven.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.themeheven.com</link>
	<description>WordPress, Ajax, Jquery, Web 2.0, PHP, Tutorials, Tips, Tricks</description>
	<lastBuildDate>Wed, 13 Jan 2010 09:37:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQuery addClass(), removeClass(), toggleClass() Tutorial</title>
		<link>http://www.themeheven.com/2009/09/jquery-addclass-removeclass-toggleclass-tutorial/</link>
		<comments>http://www.themeheven.com/2009/09/jquery-addclass-removeclass-toggleclass-tutorial/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 09:17:41 +0000</pubDate>
		<dc:creator>themeheven</dc:creator>
				<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://www.themeheven.com/?p=266</guid>
		<description><![CDATA[Adding and removing and toggle CSS classes is a effective method to highlight changes in web pages. jQuery provides different Attributes for .addClass(), .removeClass() and toggleClass methods.
addClass():
jQuery:
&#60;script type="text/javascript"&#62;
$(document).ready(function(){
$("p.list").click(function(){
$(this).addClass("active");
});
});
&#60;/script&#62;
The CSS:
&#60;style type="text/css"&#62;
p{
float: left;
width: 33.3%;
padding: 0;
margin: 0;
}
.block {
margin-right: 10px;
padding: 20px;
background: #fff;
}
.active {background: #ccc;}
&#60;/style&#62;
removeClass():
jQuery:
$(document).ready(function(){
$("p.list").click(function(){
$(this).removeClass("list");
});
});
The CSS:
&#60;style type="text/css"&#62;
p {
float: left;
width: 33.3%;
padding: 0;
margin: 0;
margin-right: 10px;
padding: 20px;
}
.list{
margin-right: 10px;
padding: 20px;
background: #CCCCCC;
}
&#60;/style&#62;
toggleClass():
jQuery:
&#60;script&#62;
$(document).ready(function(){
$("p.list").click(function(){
$(this).toggleClass("active");
});
});
&#60;/script&#62;
The CSS:
&#60;style type="text/css"&#62;
p{
float: left;
width: [...]]]></description>
			<content:encoded><![CDATA[<p>Adding and removing and toggle CSS classes is a effective method to highlight changes in web pages. jQuery provides different Attributes for .addClass(), .removeClass() and toggleClass methods.</p>
<p><strong>addClass():</strong></p>
<p>jQuery:</p>
<pre>&lt;script type="text/javascript"&gt;
$(document).ready(function(){
$("p.list").click(function(){
$(this).addClass("active");
});
});
&lt;/script&gt;</pre>
<p>The CSS:</p>
<pre>&lt;style type="text/css"&gt;
p{
float: left;
width: 33.3%;
padding: 0;
margin: 0;
}
.block {
margin-right: 10px;
padding: 20px;
background: #fff;
}
.active {background: #ccc;}
&lt;/style&gt;</pre>
<p><strong>removeClass():</strong></p>
<p>jQuery:</p>
<pre>$(document).ready(function(){
$("p.list").click(function(){
$(this).removeClass("list");
});
});</pre>
<p>The CSS:</p>
<pre>&lt;style type="text/css"&gt;
p {
float: left;
width: 33.3%;
padding: 0;
margin: 0;
margin-right: 10px;
padding: 20px;
}
.list{
margin-right: 10px;
padding: 20px;
background: #CCCCCC;
}
&lt;/style&gt;</pre>
<p><strong>toggleClass():</strong></p>
<p>jQuery:</p>
<pre>&lt;script&gt;
$(document).ready(function(){
$("p.list").click(function(){
$(this).toggleClass("active");
});
});
&lt;/script&gt;</pre>
<p>The CSS:</p>
<pre>&lt;style type="text/css"&gt;
p{
float: left;
width: 33.3%;
padding: 0;
margin: 0;
}
.block {
margin-right: 10px;
padding: 20px;
background: #fff;
}
.active {background: #ccc;}
&lt;/style&gt;</pre>
<h3>Most Commented Posts</h3>
<ul class="related_post">
<li><a href="http://www.themeheven.com/2009/03/display-wordpress-content-outside-of-your-blog/" title="Display Wordpress content outside of your blog">Display Wordpress content outside of your blog</a></li>
<li><a href="http://www.themeheven.com/2009/03/top-10-magazine-wordpress-themes-from-premiumthemes/" title="Top 10 Magazine WordPress Themes from Premiumthemes">Top 10 Magazine WordPress Themes from Premiumthemes</a></li>
<li><a href="http://www.themeheven.com/2009/04/wordpress-meta-tags-plugin/" title="WordPress Meta-Tags Plugin">WordPress Meta-Tags Plugin</a></li>
<li><a href="http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/" title="Simple JQuery Image Slide Show with Semi-Transparent Caption">Simple JQuery Image Slide Show with Semi-Transparent Caption</a></li>
<li><a href="http://www.themeheven.com/2009/06/web-2-0-and-seo/" title="Web 2.0 and SEO">Web 2.0 and SEO</a></li>
<li><a href="http://www.themeheven.com/2009/03/photoshop-tutorial-sites/" title="Photoshop Tutorial Sites">Photoshop Tutorial Sites</a></li>
<li><a href="http://www.themeheven.com/2009/04/how-to-embed-google-ad-in-your-post/" title="How to: Embed Google Ad in your post">How to: Embed Google Ad in your post</a></li>
<li><a href="http://www.themeheven.com/2009/04/wordpress-tips-and-tricks/" title="Wordpress Tips and Tricks">Wordpress Tips and Tricks</a></li>
<li><a href="http://www.themeheven.com/2009/04/digital-photography-tutorial-and-tips/" title="Digital Photography Tutorial and Tips">Digital Photography Tutorial and Tips</a></li>
<li><a href="http://www.themeheven.com/2009/05/useful-wordpress-tricks-to-make-your-theme-even-better/" title="Useful Wordpress Tricks to Make Your Theme Even Better">Useful Wordpress Tricks to Make Your Theme Even Better</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.themeheven.com/2009/09/jquery-addclass-removeclass-toggleclass-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial</title>
		<link>http://www.themeheven.com/2009/06/7-jquery-tabbed-interface-tabbed-structure-menu-tutorial/</link>
		<comments>http://www.themeheven.com/2009/06/7-jquery-tabbed-interface-tabbed-structure-menu-tutorial/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 06:51:39 +0000</pubDate>
		<dc:creator>themeheven</dc:creator>
				<category><![CDATA[Jquery]]></category>
		<category><![CDATA[jquery tabbed menu]]></category>

		<guid isPermaLink="false">http://www.themeheven.com/?p=195</guid>
		<description><![CDATA[1. YensDesign 

View Tutorial &#124; View Demo
2. Stilbuero

View Tutorial &#124; View Demo
3. Queness

View Tutorial &#124; View Demo &#124; Download
4. Cssmenubuilder

View Tutorial &#124; View Demo1 &#124; View Demo 2 
5. Nettuts

View Tutorial &#124; View Demo &#124; Download 
6.Apricot-studios

View Tutorial &#124; View Demo
7.Cutterscrossing

View Tutorial &#124; View Demo 
See Also Following Topics:

Simple JQuery Image Slide Show with Semi-Transparent [...]]]></description>
			<content:encoded><![CDATA[<p>1. <a href="http://yensdesign.com/2008/12/create-a-smooth-tabbed-menu-in-jquery/" target="_blank">YensDesign </a></p>
<p><img src="http://www.themeheven.com/wp-content/uploads/2009/06/jquery_tabbed_menu1.gif" alt="" width="419" height="251" /></p>
<p><a href="http://yensdesign.com/2008/12/create-a-smooth-tabbed-menu-in-jquery/" target="_blank">View Tutorial</a> | <a href="http://yensdesign.com/tutorials/tabs/" target="_blank">View Demo</a></p>
<p>2. <a href="http://stilbuero.de/jquery/tabs/#fragment-3" target="_blank">Stilbuero</a></p>
<p><img src="http://www.themeheven.com/wp-content/uploads/2009/06/tabbed_menu_with_effect.gif" alt="" width="500" height="298" /></p>
<p><a href="http://www.stilbuero.de/2006/05/13/accessible-unobtrusive-javascript-tabs-with-jquery/" target="_blank">View Tutorial</a> | <a href="http://stilbuero.de/jquery/tabs/" target="_blank">View Demo</a></p>
<p>3. <a href="http://www.queness.com/post/106/jquery-tabbed-interfacetabbed-structure-menu-tutorial" target="_blank">Queness</a></p>
<p><img src="http://www.themeheven.com/wp-content/uploads/2009/06/jquery_tabbed_menu2.gif" alt="" width="366" height="329" /></p>
<p><a href="http://www.queness.com/post/106/jquery-tabbed-interfacetabbed-structure-menu-tutorial" target="_blank">View Tutorial </a>| <a href="http://www.queness.com/resources/html/tabmenu/jquery-tabbed-menu-queness.html" target="_blank">View Demo</a> | <a href="http://www.queness.com/resources/archives/jquery-tab-menu.zip" target="_blank">Download</a></p>
<p>4. <a href="http://www.cssmenubuilder.com/blog/2008/09/28/jquery-tabbed-content-example/" target="_blank">Cssmenubuilder</a></p>
<p><img src="http://www.themeheven.com/wp-content/uploads/2009/06/tabbed_menu_1.gif" alt="" width="416" height="638" /></p>
<p><a href="http://www.cssmenubuilder.com/blog/2008/09/28/jquery-tabbed-content-example/" target="_blank">View Tutorial</a> | <a href="http://cssmenubuilder.com/tutorial-files/jquery-tabs/example" target="_blank">View Demo1</a> | <a href="http://cssmenubuilder.com/tutorial-files/jquery-tabs/example2" target="_blank">View Demo 2 </a></p>
<p>5. <a href="http://nettuts.com/javascript-ajax/create-a-tabbed-interface-using-jquery/">Nettuts</a></p>
<p><img src="http://www.themeheven.com/wp-content/uploads/2009/06/tabbedmenu.gif" alt="" width="342" height="565" /></p>
<p><a href="http://nettuts.com/javascript-ajax/create-a-tabbed-interface-using-jquery/" target="_blank">View Tutorial</a> | <a href="http://nettuts.s3.amazonaws.com/042_jQueryUITabs/demo/index.html" target="_blank">View Demo</a> | <a href="http://nettuts.s3.amazonaws.com/042_jQueryUITabs/source.zip" target="_blank">Download </a></p>
<p>6.<a href="http://www.apricot-studios.com/lab/jquery/jquery-tabs-tutorial.php" target="_blank">Apricot-studios</a></p>
<p><img src="http://www.themeheven.com/wp-content/uploads/2009/06/tabbed-menu.gif" alt="" width="500" height="238" /></p>
<p><a href="http://apricotstudios.wordpress.com/2008/08/29/jquery-tabs-tutorial/" target="_blank">View Tutorial</a> | <a href="http://www.apricot-studios.com/lab/jquery/jquery-tabs-tutorial.php" target="_blank">View Demo</a></p>
<p>7.<a href="http://blog.cutterscrossing.com/index.cfm/2007/6/15/Updated-JQuery-Nested-Tab-Set-with-Demo" target="_blank">Cutterscrossing</a></p>
<p><img src="http://www.themeheven.com/wp-content/uploads/2009/06/multitabbed.gif" alt="" width="457" height="215" /></p>
<p><a href="http://blog.cutterscrossing.com/index.cfm/2007/6/15/Updated-JQuery-Nested-Tab-Set-with-Demo" target="_blank">View Tutorial</a> | <a href="http://blog.cutterscrossing.com/index.cfm/2007/6/15/Updated-JQuery-Nested-Tab-Set-with-Demo" target="_blank">View Demo </a><br />
<h3>See Also Following Topics:</h3>
<ul class="related_post">
<li><a href="http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/" title="Simple JQuery Image Slide Show with Semi-Transparent Caption">Simple JQuery Image Slide Show with Semi-Transparent Caption</a></li>
<li><a href="http://www.themeheven.com/2009/06/create-a-slideshow-using-jquery/" title="Create a Slideshow Using jQuery">Create a Slideshow Using jQuery</a></li>
<li><a href="http://www.themeheven.com/2009/04/jquery-tips-and-tricks/" title="jQuery Tips and Tricks">jQuery Tips and Tricks</a></li>
<li><a href="http://www.themeheven.com/2009/04/jquery-cheatsheet/" title="jQuery Cheatsheet">jQuery Cheatsheet</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.themeheven.com/2009/06/7-jquery-tabbed-interface-tabbed-structure-menu-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple JQuery Image Slide Show with Semi-Transparent Caption</title>
		<link>http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/</link>
		<comments>http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 05:59:31 +0000</pubDate>
		<dc:creator>themeheven</dc:creator>
				<category><![CDATA[Jquery]]></category>
		<category><![CDATA[jquery slideshow]]></category>

		<guid isPermaLink="false">http://www.themeheven.com/?p=185</guid>
		<description><![CDATA[Introduction
Image Slide Show is one of the famous components in web design and development. A lot of the websites display news headlines in an image slide show to attract viewers attention, of course, with caption/excerpt. No doubt about it, this is a clever method not only to gain attentions, but it also makes the website [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Image Slide Show is one of the famous components in web design and development. A lot of the websites display news headlines in an image slide show to attract viewers attention, of course, with caption/excerpt. No doubt about it, this is a clever method not only to gain attentions, but it also makes the website more alive (not too static, dull).</p>
<p>So, here we go again, I separated my codes into 3 sections: html, css and javascript and I will explain how it works in each section.</p>
<p><strong>1. HTML</strong></p>
<p>My ultimate objective is &#8211; to keep the html as simple as possible. So, the final product is as following. The first image has a class called &#8220;show&#8221;. Class show has higher z-index, so image with this class will display on top, thus image with this class will always display on top of the rest. The second thing you need to know is the DIV with &#8220;caption&#8221; class. It has the highest z-index. That DIV will be used to display the caption. The caption is retrieve from the REL attribute in the img element. You can put html element in the REL attribute. Be aware of extra padding and margin of the html elements you used. (eg h1, p).</p>
<p>Have a look at the html code:</p>
<pre><code>&lt;div id="gallery"&gt;
&lt;a href="#" class="show"&gt;
&lt;img src="images/flowing-rock.jpg" alt="Flowing Rock" alt="" title="" width="580" height="360" rel="&lt;h3&gt;Flowing Rock&lt;/h3&gt;You can put html element
  inside the REL attribute."/&gt;&lt;/a&gt;
&lt;/a&gt;
&lt;a href="#"&gt;
&lt;img src="images/grass-blades.jpg" alt="Grass Blades" alt="" title="" width="580" height="360" rel="&lt;h3&gt;Grass Blades&lt;/h3&gt;description"/&gt;
&lt;/a&gt;

  ......
  ......
  ......
&lt;div class="caption"&gt;&lt;div class="content"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="clear"&gt;&lt;/div&gt;
</code></pre>
<p><strong>2. CSS</strong></p>
<p>In this section, I declared a container #gallery for this image slide show. The CSS for this tutorial is pretty straight foward, the most importance thing is the z-index. You have to make sure the &#8220;show&#8221; class z-index is lower than the &#8220;caption&#8221; z-index.</p>
<pre><code>body{	font-family:arial}

.clear {
  clear:both
  }

#gallery {
  position:relative;
  height:360px
  }
  #gallery a {
  float:left;
  position:absolute;
  }

  #gallery a img {
  border:none;
  }

  #gallery a.show {
  z-index:500
  }

#gallery .caption {
  z-index:600;
  background-color:#000;
  color:#ffffff;
  height:100px;
  width:100%;
  position:absolute;
  bottom:0;
  }

 #gallery .caption .content {
  margin:5px
  }

  #gallery .caption .content h3 {
  margin:0;
  padding:0;
  color:#1DCCEF;
  }
</code></pre>
<p><strong>3. Javascript</strong></p>
<p>Finally, the Javascript code. I have added comments in each line to explain what it does. My concept for this image slide show:</p>
<ul>
<li>Hide all the images</li>
<li> Display the first image and caption</li>
<li> Find the image with &#8220;show&#8221; class, and grab the next image using next() method</li>
<li> Add &#8220;show&#8221; class to next image</li>
<li> Animate the image (fadeout the current image, fadein next image)</li>
<li> And, it repeats above steps over and over again</li>
</ul>
<pre><code>$(document).ready(function() {		

	//Execute the slideShow	slideShow();

});

function slideShow() {

 //Set the opacity of all images to 0
  $('#gallery a').css({opacity: 0.0});

  //Get the first image and display it (set it to full opacity)
  $('#gallery a:first').css({opacity: 1.0});

  //Set the caption background to semi-transparent
  $('#gallery .caption').css({opacity: 0.7});

 //Resize the width of the caption according to the image width
  $('#gallery .caption').css({width: $('#gallery a').find('img').css('width')});

  //Get the caption of the first image from REL attribute and display it
  $('#gallery .content').html($('#gallery a:first').find('img').attr('rel'))
  .animate({opacity: 0.7}, 400);

  //Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
  setInterval('gallery()',6000);

  }

function gallery() {

  //if no IMGs have the show class, grab the first image
  var current = ($('#gallery a.show')? $('#gallery a.show') : $('#gallery a:first'));

 //Get next image, if it reached the end of the slideshow, rotate it back to the first image
  var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first')); 

  //Get next image caption
  var caption = next.find('img').attr('rel'); 

  //Set the fade in effect for the next image, show class has higher z-index
  next.css({opacity: 0.0})
  .addClass('show')
  .animate({opacity: 1.0}, 1000);

 //Hide the current image
  current.animate({opacity: 0.0}, 1000)
  .removeClass('show');

  //Set the opacity to 0 and height to 1px
  $('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 }); 

  //Animate the caption, opacity to 0.7 and heigth to 100px, a slide up effect
  $('#gallery .caption').animate({opacity: 0.7},100 ).animate({height: '100px'},500 );

  //Display the content
  $('#gallery .content').html(caption);

  }
</code></pre>
<p><a href="http://www.queness.com/resources/html/slideshow/jquery-slideshow.html" target="_blank">View Demo</a> | <a href="http://www.queness.com/resources/archives/jquery-slideshow.zip" target="_blank">Download Zip</a></p>
<p>Original Post By: <a href="http://www.queness.com/post/152/simple-jquery-image-slide-show-with-semi-transparent-caption" target="_blank">Queness</a><br />
<h3>See Also Following Topics:</h3>
<ul class="related_post">
<li><a href="http://www.themeheven.com/2009/06/create-a-slideshow-using-jquery/" title="Create a Slideshow Using jQuery">Create a Slideshow Using jQuery</a></li>
<li><a href="http://www.themeheven.com/2009/06/7-jquery-tabbed-interface-tabbed-structure-menu-tutorial/" title="7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial">7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial</a></li>
<li><a href="http://www.themeheven.com/2009/04/jquery-tips-and-tricks/" title="jQuery Tips and Tricks">jQuery Tips and Tricks</a></li>
<li><a href="http://www.themeheven.com/2009/04/jquery-cheatsheet/" title="jQuery Cheatsheet">jQuery Cheatsheet</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Create a Slideshow Using jQuery</title>
		<link>http://www.themeheven.com/2009/06/create-a-slideshow-using-jquery/</link>
		<comments>http://www.themeheven.com/2009/06/create-a-slideshow-using-jquery/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 05:55:19 +0000</pubDate>
		<dc:creator>themeheven</dc:creator>
				<category><![CDATA[Jquery]]></category>
		<category><![CDATA[jquery slideshow]]></category>

		<guid isPermaLink="false">http://www.themeheven.com/?p=183</guid>
		<description><![CDATA[The most important part of any good web component is a solid HTML structure. A semantic foundation means that your content will be web accessible in virtually all browser clients.
Our content’s structure involves a div called #slideshow that serves as the container for our slideshow. Nested inside it is another div called #slideContainer that holds [...]]]></description>
			<content:encoded><![CDATA[<p>The most important part of any good web component is a solid HTML structure. A semantic foundation means that your content will be web accessible in virtually all browser clients.</p>
<p>Our content’s structure involves a div called #slideshow that serves as the container for our slideshow. Nested inside it is another div called #slideContainer that holds the slides, which are divs with a class set to .slide.</p>
<p><strong>The HTML markup:</strong></p>
<pre><code>
&lt;!-- Slideshow HTML --&gt;&lt;div id="slideshow"&gt;  &lt;div id="slidesContainer"&gt;    &lt;div class="slide"&gt;      &lt;!-- Content for slide 1 goes here --&gt;    &lt;/div&gt;    &lt;div class="slide"&gt;      &lt;!-- Content for slide 2 goes here. --&gt;    &lt;/div&gt;    &lt;div class="slide"&gt;      &lt;!-- Content for slide 3 goes here. --&gt;    &lt;/div&gt;    &lt;div class="slide"&gt;      &lt;!-- Content for slide 4 goes here. --&gt;    &lt;/div&gt;  &lt;/div&gt;&lt;/div&gt;&lt;!-- Slideshow HTML --&gt;
</code></pre>
<p>In example 1 below, you’ll see how text-based browsers, and browsers incapable of rendering CSS and JavaScript, will see our slideshow. It’s important to note that all of our content is easily accessible; we’ve hidden nothing from the user &#8211; ensuring that everyone will have the ability to view our content.</p>
<p>There is also no markup for the left and right arrow controls, which we will insert into the DOM later on using JavaScript. Having them in the content structure level would be confusing to individuals without CSS or JavaScript capabilities.</p>
<p><a name="css"><strong>CSS Style:</strong></p>
<p></a></p>
<p>he next step to a strong design is having a good set of styles that consider the possibility that the user has JavaScript disabled.</p>
<p>For #slidesContainer, we set the overflow property to auto so that scroll bars appear when our content overflows over the set height of 263px (the height of our slides).</p>
<p><strong>#slidesContainer CSS</strong></p>
<pre><code>
#slideshow #slidesContainer {  margin:0 auto;  width:560px;  height:263px;  overflow:auto; /* allow scrollbar */  position:relative;}</code></pre>
<p>We have to reduce the width of the .slide div class by 20px to accommodate the right hand scroll bar that will appear when JavaScript is turned off.</p>
<p><strong>.slide class CSS</strong></p>
<pre><code>
#slideshow #slidesContainer .slide {  margin:0 auto;  width:540px; /* reduce by 20 pixels to avoid horizontal scroll */  height:263px;}
</code></pre>
<p>Without JavaScript, our content is still accessible; users can scroll up and down using to view our slides.</p>
<p><strong>Slideshow without JavaScript</strong></p>
<p>Alternatively, you can give the .slide style rule a float:left; property so that instead of scrolling vertically, users can scroll horizontally.</p>
<p><strong>Left and right arrow CSS</strong></p>
<p>To save some JavaScript rendering resources, we’ll declare style rules for the left and arrow controls that we will insert in the DOM via jQuery.</p>
<p>The elements will be &lt;span&gt; elements, so we declare a cursor property and assign it the value of pointer to change the mouse pointer when the user hovers over the controls. We use the text-indent property to hide the text out of sight, a CSS background image replacement method.</p>
<p><strong> Controls</strong></p>
<pre><code>/** * Slideshow controls style rules. */.control {  display:block;  width:39px;  height:263px;  text-indent:-10000px;  position:absolute;  cursor: pointer;}#leftControl {  top:0;  left:0;  background:transparent url(img/control_left.jpg) no-repeat 0 0;}#rightControl {  top:0;  right:0;  background:transparent url(img/control_right.jpg) no-repeat 0 0;}</code></pre>
<p><strong>The best part… JavaScript</strong></p>
<p>With our HTML and CSS in place, it’s time for the fun stuff. We’ll use the jQuery library to make our slideshow more interactive and animated.</p>
<p><strong>The theory</strong></p>
<p>The first thing we want to do is ‘undo’ the styles that we declared in CSS that deals with the JavaScript off scenario. This involves declaring CSS styles in JavaScript for #slidesContainer to remove its scroll bar. Additionally, we have to resize our .slide divs to 560px, which we reduced by 20px in to accommodate the scroll bar. We also want to float the divs to the left so that they are displayed side by side horizontally instead of stacked on top of each other vertically.</p>
<p>Then, by DOM manipulation, we insert a div called #slideInner that wraps around all of our slides that has a width equal to the total width of all the .slide div.</p>
<p>Finally, we insert left and right controls (with class names of .control) for user navigation; we do this in JavaScript so that browser clients that don’t have JavaScript enabled won’t see the controls.</p>
<p>Here’s the JavaScript code in its entirety for you to study, but we’ll go through it in detail afterwards.</p>
<p><strong>The entire jQuery script</strong></p>
<pre><code>

$(document).ready(function(){  var currentPosition = 0;  var slideWidth = 560;  var slides = $('.slide');  var numberOfSlides = slides.length;

 // Remove scrollbar in JS
  $('#slidesContainer').css('overflow', 'hidden');

 // Wrap all .slides with #slideInner div
  slides
  .wrapAll('&lt;div id="slideInner"&gt;&lt;/div&gt;')
  // Float left to display horizontally, readjust .slides width
  .css({
  'float' : 'left',
  'width' : slideWidth
  });

 // Set #slideInner width equal to total width of all slides
  $('#slideInner').css('width', slideWidth * numberOfSlides);

 // Insert left and right arrow controls in the DOM
  $('#slideshow')
  .prepend('&lt;span class="control" id="leftControl"&gt;Move left&lt;/span&gt;')
  .append('&lt;span class="control" id="rightControl"&gt;Move right&lt;/span&gt;');

 // Hide left arrow control on first load
  manageControls(currentPosition);

 // Create event listeners for .controls clicks
  $('.control')
  .bind('click', function(){
  // Determine new position
  currentPosition = ($(this).attr('id')=='rightControl')
  ? currentPosition+1 : currentPosition-1;

 // Hide / show controls
  manageControls(currentPosition);
  // Move slideInner using margin-left
  $('#slideInner').animate({
  'marginLeft' : slideWidth*(-currentPosition)
  });
  });

 // manageControls: Hides and shows controls depending on currentPosition
  function manageControls(position){
  // Hide left arrow if position is first slide
  if(position==0){ $('#leftControl').hide() }
  else{ $('#leftControl').show() }
  // Hide right arrow if position is last slide
  if(position==numberOfSlides-1){ $('#rightControl').hide() }
  else{ $('#rightControl').show() }
  }
  });
</code></pre>
<p><strong>Creating some objects</strong></p>
<p>First we initiate some variables at the top of the script that we’ll use throughout the script.</p>
<p>currentPosition will be a number that contains the current position of the slideshow. slideWidth is the width of each .slide div, which is fixed at 560px. I chose to declare an object for the $(&#8217;.slide&#8217;) selector to make our code look a bit cleaner, but you can skip this and instead use the full selector ($(&#8217;.slide&#8217;)) in your syntax.</p>
<p>Finally, we determine the number of slides in our slideshow using the .length method.</p>
<p><strong>Variables and constants</strong></p>
<pre><code>var currentPosition = 0;var slideWidth = 560;var slides = $('.slide');var numberOfSlides = slides.length;</code></pre>
<p><strong>Removing the scroll bar</strong></p>
<p>If our script runs, then our user has JavaScript enabled &#8211; so we’ll remove the scroll bar by setting the overflow property of slidesContainer to ‘hidden‘ and this will supersede the overflow:auto declaration in our <a href="#css">CSS</a></p>
<p><strong> Changing CSS overflow property value to hidden</strong></p>
<pre><code>$('#slidesContainer').css('overflow', 'hidden');</code></pre>
<p><strong>Inserting a div in the DOM</strong></p>
<p>We’ll use the margin property to move our slides left and right (more on this later). To do so, we need to create a div that wraps around all of our .slide divs, set to the same width as the total width of all our slides. By adjusting this div’s margin property (later on), we will create the effect of it moving left and right.</p>
<p><strong>Inserting #slideInner into the DOM using the .wrapAll() method</strong></p>
<pre><code>slides  .wrapAll('&lt;div  id="slideInner"&gt;&lt;/div&gt;')</code></pre>
<p>We also need to set the width of #slideInner, the newly created div, to the total width of all .slide divs.<br />
<strong>Inserting #slideInner into the DOM using the .wrapAll() method</strong></p>
<pre><code>$('#slideInner').css('width', slideWidth * numberOfSlides);</code></pre>
<p><strong>Styling the Slideshow slides in JavaScript</strong></p>
<p>With JavaScript enabled, we want to float the slides to the left so that they display side by side. We also want to set them to a width of 560px since we won’t have the scroll bar anymore.</p>
<p>We can chain the .css method along with the .wrapAll() method .</p>
<p><strong>Giving .slide divs overflow:hidden CSS property </strong></p>
<pre><code>slides  .css('overflow', 'hidden')  .wrapAll('&lt;div  id="slideInner"&gt;&lt;/div&gt;')</code></pre>
<p><strong>Inserting the controls in the DOM</strong></p>
<p>We insert the controls by manipulating the DOM; this way, users using JavaScript-disabled browsers and screen readers won’t have an invalid HTML structure with controls that take them nowhere which would be confusing because clicking on them would not work without JavaScript.</p>
<p>We do this using the .prepend() and .append() method which inserts an HTML string inside the selected object/s (in this case, the #slideshow div is selected). The text inside the span elements don’t matter because they were hidden</p>
<p><strong>Inserting the controls in the DOM</strong></p>
<pre><code>$('#slideshow')  .prepend('&lt;span class="control" id="leftControl"&gt;Moves left&lt;/span&gt;')  .append('&lt;span class="control" id="rightControl"&gt;Moves right&lt;/span&gt;');</code></pre>
<p><strong>Managing the left and right arrow controls with a function</strong></p>
<p>To manage our controls, we create a function called manageControls that hides and shows the left and right arrow controls based on the current position of the slideshow.</p>
<p>If it’s on the first slide, we hide the left control because there is no preceding slide. On the last slide, we hide the right control because the user has reached the end of the slideshow. We do this by using the .hide() and .show() jQuery methods that hides/shows the selected DOM element/s that precedes it.</p>
<p><strong>the manageControls() function</strong></p>
<p><strong></p>
<pre><code>function  manageControls(position){  // position==0 is first slide  if(position==0)  { $('#leftControl').hide(); }  else { $('#leftControl').show(); }    // numberOfSlides-1 is last slides  if(position==numberOfSlides-1) {  $('#rightControl').hide(); }  else { $('#rightControl').show(); }}      </code></pre>
<p></strong></p>
<p><strong>Call manageControls() on DOM ready</strong></p>
<p>When our first script loads, we should call the manageControls() function once to hide the left arrow control. Calling it is easy, we just pass the currentPosition argument into it which should be 0 initially.</p>
<p><strong>calling manageControls() on script load (domready event)</strong></p>
<pre><code>manageControls(currentPosition);</code></pre>
<p><strong>Binding click events to the controls</strong></p>
<p>The final step to the jQuery slideshow script is binding events to the left and right controls. This essentially creates &#8220;event listeners&#8221; that triggers functions when the user clicks on either the left or right arrow controls.</p>
<p><strong> Binding a click event listener to .control class</strong></p>
<pre><code>$('.control').bind('click',  function(){  // do something when user clicks});</code></pre>
<p><strong>Updating the value of currentPosition</strong></p>
<p>When the user clicks on a control, we update the value of the currentPosition variable: if the user clicks on the right arrow control (with the ID of #rightControl) then we add one to our currentPosition; if the user clicks on the left arrow control (with the ID of #lefControl), then we subtract 1 from currentPosition. What you see below is called a ternary operator, which is shorthand for if/else control structures.</p>
<p><strong>Ternary operator to set new value of currentPosition</strong></p>
<pre><code>currentPosition = ($(this).attr('id')=='rightControl')                  ?  currentPosition+1 : currentPosition-1;</code></pre>
<p><strong>Calling manageControls() after updating currentPosition</strong></p>
<p>After we’ve adjusted the value of currentPosition, we call manageControls() again to hide or show our controls based on our new slide position.</p>
<p><strong>Calling manageControls() inside .bind method</strong></p>
<pre><code>manageControls(currentPosition);</code></pre>
<p><strong>Animating the slides</strong></p>
<p>Finally, we move #slideInner to the left or right by animating it’s margin-left CSS property value. The left margin is the negative of the width of our slides multiplied by our current position. For example, if we’re moving to Slide 3, then our left margin is equal to -1120px.</p>
<p><strong>Using .animate method to transition margin-left CSS property</strong></p>
<pre><code>$('#slideInner').animate({  'marginLeft' : slideWidth*(-currentPosition)});</code></pre>
<p>Originally Post By :<a href="http://sixrevisions.com/tutorials/javascript_tutorial/create-a-slick-and-accessible-slideshow-using-jquery/" target="_blank">SixRevision</a><br />
<h3>See Also Following Topics:</h3>
<ul class="related_post">
<li><a href="http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/" title="Simple JQuery Image Slide Show with Semi-Transparent Caption">Simple JQuery Image Slide Show with Semi-Transparent Caption</a></li>
<li><a href="http://www.themeheven.com/2009/06/7-jquery-tabbed-interface-tabbed-structure-menu-tutorial/" title="7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial">7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial</a></li>
<li><a href="http://www.themeheven.com/2009/04/jquery-tips-and-tricks/" title="jQuery Tips and Tricks">jQuery Tips and Tricks</a></li>
<li><a href="http://www.themeheven.com/2009/04/jquery-cheatsheet/" title="jQuery Cheatsheet">jQuery Cheatsheet</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.themeheven.com/2009/06/create-a-slideshow-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Tips and Tricks</title>
		<link>http://www.themeheven.com/2009/04/jquery-tips-and-tricks/</link>
		<comments>http://www.themeheven.com/2009/04/jquery-tips-and-tricks/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 06:17:33 +0000</pubDate>
		<dc:creator>themeheven</dc:creator>
				<category><![CDATA[HOW TO]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[jquery tips n tricks]]></category>

		<guid isPermaLink="false">http://www.themeheven.com/?p=140</guid>
		<description><![CDATA[1. jQuery $(document).ready shorthand
This is a great tip! Instead of doing this
$(document).ready(function() { 

  //write your code here 

  } 
You can also do this, both are the same!
$(function(){
   //write your code here
 });
2. Switch to different CSS style sheets
You want to have different design for your website. You can use [...]]]></description>
			<content:encoded><![CDATA[<h3>1. jQuery $(document).ready shorthand</h3>
<p>This is a great tip! Instead of doing this</p>
<pre><code>$(document).ready(function() { 

  //write your code here 

  } </code></pre>
<p>You can also do this, both are the same!</p>
<pre><code>$(function(){
   //write your code here
 });</code></pre>
<h3>2. Switch to different CSS style sheets</h3>
<p>You want to have different design for your website. You can use this to switch to different CSS Style Sheets:</p>
<pre><code>$("a.cssSwitcher]").click(function() {
    //swicth the LINK REL attribute with the value in A REL attribute
    $("link[rel=stylesheet]").attr({href : this.attr(rel)});
});   </code></pre>
<pre><code>&lt;link rel="stylesheet" href="default.css" type="text/css"&gt;
......
&lt;a href="#" class="cssSwitcher" rel="default.css"&gt;Default Theme&lt;/a&gt;
&lt;a href="#" class="cssSwitcher" rel="red.css"&gt;Red Theme&lt;/a&gt;
&lt;a href="#" class="cssSwitcher" rel="blue.css"&gt;Blue Theme&lt;/a&gt;</code></pre>
<h4>3. Disable right click</h4>
<p>Some of us might want to disable right click, or want to create our own context menu for the website, this is how we can detect right click:</p>
<pre><code>$(document).bind("contextmenu",function(e){
    //you can enter your code here, e.g a menu list   

    //cancel the default context menu
    return false;
});   </code></pre>
<h3>4.  Text Resizing With jQuery</h3>
<p>Ever wondered how to allow visitors to increase or decrease the text size (font size) on your website? I’m going to show you how &#8211; using jQuery (a great JavaScript library).</p>
<pre><code>$(document).ready(function(){   

    //ID, class and tag element that font size is adjustable in this array
    //Put in html or body if you want the font of the entire page adjustable
    var section = new Array('span','.section2');
    section = section.join(',');   

    // Reset Font Size
    var originalFontSize = $(section).css('font-size');
        $(".resetFont").click(function(){
        $(section).css('font-size', originalFontSize);
    });
    // Increase Font Size
    $(".increaseFont").click(function(){
        var currentFontSize = $(section).css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum*1.2;
        $(section).css('font-size', newFontSize);
        return false;
    });   

    // Decrease Font Size
    $(".decreaseFont").click(function(){
        var currentFontSize = $(section).css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum*0.8;
        $(section).css('font-size', newFontSize);
        return false;
    });
});   </code></pre>
<pre><code>&lt;a class="increaseFont"&gt;+&lt;/a&gt; |
&lt;a class="decreaseFont"&gt;-&lt;/a&gt; |
&lt;a class="resetFont"&gt;=&lt;/a&gt;
&lt;span&gt;Font size can be changed in this section&lt;/span&gt;
&lt;div class="section1"&gt;This won't be affected&lt;/div&gt;
&lt;div class="section2"&gt;This one is adjustable too!&lt;/div&gt;
</code></pre>
<h3>5.  How to disabled/enable an element with jQuery</h3>
<pre><code>// To disable
$('.someElement').attr('disabled', 'disabled');    

// To enable
$('.someElement').removeAttr('disabled');
// OR you can set attr to ""
$('.someElement').attr('disabled', '');   </code></pre>
<h3>6. Let Google host jQuery for you</h3>
<pre><code>&lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
google.load("jquery", "1.2.6");
google.setOnLoadCallback(function() {
    //Code to be inserted in this area
});
&lt;/script&gt;   

/* the best way (fastest and most efficient implementation) */
&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
    //This is more like it!
  });
&lt;/script&gt;  </code></pre>
<h3>7. No conflict-mode</h3>
<pre><code>jQuery.noConflict();</code></pre>
<p>&#8220;Run this function to give control of the $ variable back to whichever library first implemented it. This helps to make sure that jQuery doesn&#8217;t conflict with the $ object of other libraries.</p>
<p>By using this function, you will only be able to access jQuery using the jQuery variable. For example, where you used to do $(&#8221;div p&#8221;), you now must do jQuery(&#8221;div p&#8221;)&#8221;.</p>
<h3>8. Line breaks and chainability</h3>
<p>Instead of doing:</p>
<pre><code>$("a").hide().addClass().fadeIn().hide();</code></pre>
<p>You can increase readability like so:</p>
<pre><code> $("a")

   .hide()

   .addClass()

   .fadeIn()

   .hide();</code></pre>
<h3>9.  Write our own selector</h3>
<pre><code>//extend the jQuery functionality
$.extend($.expr[':'], {     

    //name of your special selector
    moreThanAThousand : function (a){
        //Matching element
        return parseInt($(a).html()) &gt; 1000;
    }
});     

$(document).ready(function() {
    $('td:moreThanAThousand').css('background-color', '#ff0000');
});   </code></pre>
<pre><code>&lt;TABLE&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;1400&lt;/td&gt;&lt;td&gt;700&lt;/td&gt;&lt;td&gt;400&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2500&lt;/td&gt;&lt;td&gt;600&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;1100&lt;/td&gt;&lt;td&gt;900&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2600&lt;/td&gt;&lt;td&gt;1100&lt;/td&gt;&lt;td&gt;1200&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/TABLE&gt;   </code></pre>
<h3>10. Columns of equal height</h3>
<pre><code>$(document).ready(function() {
    setHeight('.col');
});   

//global variable, this will store the highest height value
var maxHeight = 0;   

function setHeight(col) {
    //Get all the element with class = col
    col = $(col);   

    //Loop all the col
    col.each(function() {           

        //Store the highest value
        if($(this).height() &gt; maxHeight) {
            maxHeight = $(this).height();;
        }
    });   

    //Set the height
    col.height(maxHeight);
}   </code></pre>
<pre><code>&lt;div class="col" style="border:1px solid"&gt;Column One&lt;br/&gt;
With Two Line&lt;br/&gt;
And the height is different&lt;br/&gt;&lt;br/&gt;
&lt;/div&gt;
&lt;div class="col" style="border:1px solid"&gt;Column Two&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;   </code></pre>
<h3>11.  Back to top button/link</h3>
<p>With this plugin, you will easily scroll overflowed elements, and the screen itself.</p>
<p>It gives you access to many different options to customize and various ways to specify where to scroll.</p>
<pre><code>$('#top').click(function() {
    $(document).scrollTo(0,500);
}   </code></pre>
<pre><code>&lt;script type="text/javascript" src="js/jquery.scrollTo-min.js"&gt;&lt;/script&gt;
......
&lt;a id="top" style="cursor:hand;cursor:pointer"&gt;
Back to top   </code></pre>
<h3>12. Prevent default behaviour</h3>
<p>Assuming we have a long page, and we have a link similar to below that is used for other purposes other than a hyperlink. If you clicked on it, it will bring you to the top of your page. The reason of this behavior is because of the # symbol. To solve this problem, we need to cancel the default behavior by doing this:</p>
<pre><code>$('#close').click(function(e){
     e.preventDefault();
});    

/* OR */   

$('#close').click(function(){
    return false;
});    </code></pre>
<pre><code>&lt;a href="#" id="close"&gt;&lt;/a&gt;   </code></pre>
<h3>13. Get mouse cursor x and y axis</h3>
<p>This script will display the x and y value &#8211; the coordinate of the mouse pointer.</p>
<pre><code>$().mousemove(function(e){
    //display the x and y axis values inside the P element
    $('p').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);
});   </code></pre>
<pre><code>&lt;p&gt;&lt;/p&gt;   </code></pre>
<h3>14. Open in new window</h3>
<p>Target attribute is not valid in STRICT W3C standard. Thus, we need to use REL and a bit of jQuery code to dynamically create the attribute to avoid validation error. This is one of my favourite codes. It&#8217;s so simple and does the job well.</p>
<pre><code>$('a[rel=external]').attr('target','_blank');   </code></pre>
<pre><code>&lt;a href="http://www.queness.com" rel="external"&gt;Queness in new window&lt;/a&gt;   </code></pre>
<h3>15. Check if checkbox is checked</h3>
<p>jQuery provides us 3 ways to determine if a checkbox is checked.</p>
<pre><code>// First way
$('#checkBox').attr('checked');    

// Second way
$('#edit-checkbox-id').is(':checked');    

// Third way
$("[:checkbox]:checked").each(
    function() {
       // Insert code here
    }
);   </code></pre>
<p>jQuery is a great library but I had a hard time to identify if it was checked at the time. So here is the way to do just that. All you need to do is to check checked attribute of an HTML tag:</p>
<pre><code>// First way
$('#checkBox').attr('checked');
// Second way 

    $('#edit-checkbox-id').is(':checked'); 

// Third way 

    $("input[@type=checkbox][@checked]").each( 

  function() { 

  // Insert code here 

  } 

  );</code></pre>
<h3>16. Check if jQuery.js is loaded</h3>
<pre><code>/* Method 1 */
if (jQuery) {
    // jQuery is loaded
} else {
    // jQuery is not loaded
}   

/* Method 2 */
if (typeof jQuery == 'undefined') {
    // jQuery is not loaded
} else {
    // jQuery is loaded
}   </code></pre>
<h3>17. Target blank links</h3>
<p>Do you use the target=blank attribute on links? If yes, you might know that XHTML 1.0 Strict don&#8217;t allow it. A good solution to this problem should be using JQuery to make links opening in new windows:</p>
<pre><code>$('a[@rel$='external']').click(function(){
  this.target = "_blank";
});
/*

      Usage:
&lt;a href="http://www.lepinskidesign.com.br/" rel="external"&gt;lepinskidesign.com.br&lt;/a&gt;

      */</code></pre>
<h3>18. Preloading images</h3>
<p>When you&#8217;re using images in Javascript, a good thing is to preload it before you have to use it. This code will do the job:</p>
<pre><code>jQuery.preloadImages = function()
{
  for(var i = 0; i").attr("src", arguments[i]);
  }
};
      // Usage

        $.preloadImages("image1.gif", "/path/to/image2.png", "some/image3.jpg");</code></pre>
<h3>19. Detect browser</h3>
<p>Although it is better to use CSS conditionnal comments to detect a specific browser and apply some css style, it is a very easy thing to do with JQuery, which can be useful at times.</p>
<pre><code>//A. Target Safari
if( $.browser.safari ) $("#menu li a").css("padding", "1em 1.2em" );

      //B. Target anything above IE6

        if ($.browser.msie &amp;&amp; $.browser.version &gt; 6 ) $("#menu li a").css("padding", "1em 1.8em" );

//C. Target IE6 and below

        if ($.browser.msie &amp;&amp; $.browser.version &lt;= 6 ) $("#menu li a").css("padding", "1em 1.8em" );

    //D. Target Firefox 2 and above

        if ($.browser.mozilla &amp;&amp; $.browser.version &gt;= "1.8" ) $("#menu li a").css("padding", "1em 1.8em" );
</code></pre>
<h3>20. Scroll Effect to Obj</h3>
<pre><code>// Scroll Effect to Obj
var targetOffset = $(Obj).offset().top;
$('html,body').animate({scrollTop: targetOffset}, 1000);
// Appear Effect

        $(Obj).animate({opacity: 'show', height: 'show'}, 1000);
// Appear Toggle Effect

        $(Obj).siblings('*:last').children('.part').animate({opacity: 'toggle', height: 'toggle'}, 500);

      // Message Effect

        $(Obj)

        .removeClass().addClass('message'+(type ? ' message_'+type : ''))

        .html('Your Message').show().fadeOut(1000);

     // Highlight Effect - Requires Color Plugin

        function renderer_highlight ( Obj, color )

        {

        if ( color == null ) color = 'lightyellow';

        var origColor = $(Obj).css('backgroundColor');

        $(Obj).animate(

        { backgroundColor: color },

        { duration:300,

        complete:function(){ $(this).animate({backgroundColor: origColor}, 300); }

        }

        );

        }

     // Remove all labels from #sample .actions that are not the first that are not the first

        $('#sample .actions label:not(:first)').remove();

      // Navigate the first .myText inside #myDiv

        $('#myDiv .myText:first');

        // or

        $($('#myDiv .myText')[0]);

        // or

        $($('#myDiv').find('.myText')[0]);

     // Check the last input that is not animated and is visible

        $('#sample .actions label:visible:not(:animated):last input').attr('checked', 'checked');
</code></pre>
<h3>21.</p>
<p>GridView with Select All CheckBox using JQuery</h3>
<p>One of the handy features that one might with to put on GridView is the Select All checkbox which is similar to the one on Hotmail and Yahoo. You click the checkbox on the header and all items (checkboxes underneath) get checked.</p>
<p>I&#8217;ve seen several implementation for this feature long time ago. Myself wrote one. And all solutions were using some good amount of JavaScript. Today I was thinking, why not revisit the idea again, but this time using all mighty JQuery.</p>
<p>And as expected, the amount of code used to implement this simple feature is really small. I&#8217;m going to explore the JQuery code expecting you already know ASP.NET and how to use GridView along with SqlDataSource.</p>
<p><img src="http://imagesho.comuv.com/jqutricks/jqt1.gif" alt="" width="500" height="286" /></p>
<p>CheckBoxes are rendered on the last column. I&#8217;m mentioning last column because I&#8217;m going to use that on JQuery. Also it worth to mention that this GridView will render the header columns like this:</p>
<pre><code>&lt;tr&gt;
&lt;th align="left" scope="col"&gt;Category&lt;/th&gt;
&lt;th align="left" scope="col"&gt;Product&lt;/th&gt;
&lt;th align="right" scope="col"&gt;Unit Price&lt;/th&gt;
&lt;th align="left" scope="col"&gt;Supplier&lt;/th&gt;
&lt;th scope="col"&gt;
&lt;input id="gvProducts_ctl01_chkSelectAll" type="checkbox" name="gvProducts$ctl01$chkSelectAll" /&gt;
&lt;/th&gt;
&lt;/tr&gt;</code></pre>
<p>Notice the &#8220;th&#8221; tag; again because I&#8217;ll use this from JQuery. The rest of rows are rendered as normal &#8220;td&#8221; tags</p>
<p>As I am using AJAX Enabled Web Application, I have the option ASP.NET AJAX Client Events like onload event. I&#8217;m using this event to bind click event to each CheckBox on the GridView:</p>
<p><a href="http://mosesofegypt.net/post/GridView-with-Select-All-CheckBox-using-JQuery.aspx#continue" target="_blank">More&#8230;</a></p>
<h3>22. jQuery code to select text inside an input field on user click or focus:</h3>
<pre><code>$("#myInputField").focus(function(){
    // Select input field contents
    this.select();
});
// Add this behavior to all text fields

        $("input[type=text]").focus(function(){

  // Select field contents

  this.select();

  });</code></pre>
<h3>23. Get geographical location (geolocation) by IP address using jQuery</h3>
<pre><code>{
        'status':'ok',
        'IP': '74.125.45.100',
        'CountryCode': 'US',
        'CountryName': 'United States',
        'RegionName': 'California',
        'ZipPostalCode': '94043',
        'City': 'Mountain View',
        'Latitude': '37.4192',
        'Longitude': '-122.057'
}
// In case of an error

    {

  'status':'parent server not responding'

  }</code></pre>
<h3>See Also Following Topics:</h3>
<ul class="related_post">
<li><a href="http://www.themeheven.com/2009/06/7-jquery-tabbed-interface-tabbed-structure-menu-tutorial/" title="7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial">7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial</a></li>
<li><a href="http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/" title="Simple JQuery Image Slide Show with Semi-Transparent Caption">Simple JQuery Image Slide Show with Semi-Transparent Caption</a></li>
<li><a href="http://www.themeheven.com/2009/06/create-a-slideshow-using-jquery/" title="Create a Slideshow Using jQuery">Create a Slideshow Using jQuery</a></li>
<li><a href="http://www.themeheven.com/2009/04/jquery-cheatsheet/" title="jQuery Cheatsheet">jQuery Cheatsheet</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.themeheven.com/2009/04/jquery-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Cheatsheet</title>
		<link>http://www.themeheven.com/2009/04/jquery-cheatsheet/</link>
		<comments>http://www.themeheven.com/2009/04/jquery-cheatsheet/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 05:15:49 +0000</pubDate>
		<dc:creator>themeheven</dc:creator>
				<category><![CDATA[Jquery]]></category>
		<category><![CDATA[jquery cheatsheet]]></category>

		<guid isPermaLink="false">http://www.themeheven.com/?p=137</guid>
		<description><![CDATA[
Download

Download

Download

Download

Download
jQuery Printable Cheatsheet

See Also Following Topics:

7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial
Simple JQuery Image Slide Show with Semi-Transparent Caption
Create a Slideshow Using jQuery
jQuery Tips and Tricks

]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gscottolson.com/weblog/2008/01/11/jquery-cheat-sheet/" target="_blank"><img src="http://imagesho.comuv.com/jquerytips/jq1.gif" border="0" alt="" width="500" height="340" /></a></p>
<p><a href="http://www.gscottolson.com/jquery/jQuery1.2.cheatsheet.v1.0.pdf" target="_blank">Download</a></p>
<p><a href="http://colorcharge.com/wp-content/uploads/2007/12/jquery12_colorcharge.png" target="_blank"><img src="http://imagesho.comuv.com/jquerytips/jq2.gif" border="0" alt="" width="500" height="343" /></a></p>
<p><a href="http://colorcharge.com/wp-content/uploads/2007/12/jquery12_colorcharge.png" target="_blank">Download</a></p>
<p><img src="http://imagesho.comuv.com/jquerytips/jq3.gif" alt="" width="500" height="391" /></p>
<p><a href="http://thinkweb2.com/projects/prototype/downloads/Prototype%20Cheat%20Sheet%201.6.0.2" target="_blank">Download</a></p>
<p><a href="http://cheatsheet.googlecode.com/svn/trunk/cheatsheet/src/jquery/jquery1.2-cheatsheet-1280-001.png" target="_blank"><img src="http://imagesho.comuv.com/jquerytips/jq4.gif" border="0" alt="" width="500" height="375" /></a></p>
<p><a href="http://cheatsheet.googlecode.com/svn/trunk/cheatsheet/src/jquery/jquery1.2-cheatsheet-1280-001.png" target="_blank">Download</a></p>
<p><a href="http://cheatsheet.googlecode.com/svn/trunk/cheatsheet/src/jquery/jquery1.2-cheatsheet-1280-002.png" target="_blank"><img src="http://imagesho.comuv.com/jquerytips/jq5.gif" border="0" alt="" width="500" height="375" /></a></p>
<p><a href="http://cheatsheet.googlecode.com/svn/trunk/cheatsheet/src/jquery/jquery1.2-cheatsheet-1280-002.png" target="_blank">Download</a></p>
<p>jQuery Printable Cheatsheet</p>
<p><a href="http://labs.colorcharge.com/jtouch/" target="_blank"><img src="http://imagesho.comuv.com/jquerytips/jq6.gif" border="0" alt="" width="500" height="294" /></a><br />
<h3>See Also Following Topics:</h3>
<ul class="related_post">
<li><a href="http://www.themeheven.com/2009/06/7-jquery-tabbed-interface-tabbed-structure-menu-tutorial/" title="7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial">7 jQuery Tabbed Interface / Tabbed Structure Menu Tutorial</a></li>
<li><a href="http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/" title="Simple JQuery Image Slide Show with Semi-Transparent Caption">Simple JQuery Image Slide Show with Semi-Transparent Caption</a></li>
<li><a href="http://www.themeheven.com/2009/06/create-a-slideshow-using-jquery/" title="Create a Slideshow Using jQuery">Create a Slideshow Using jQuery</a></li>
<li><a href="http://www.themeheven.com/2009/04/jquery-tips-and-tricks/" title="jQuery Tips and Tricks">jQuery Tips and Tricks</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.themeheven.com/2009/04/jquery-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>22 Useful jQuery Plugins</title>
		<link>http://www.themeheven.com/2009/04/22-useful-jquery-plugins/</link>
		<comments>http://www.themeheven.com/2009/04/22-useful-jquery-plugins/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 13:23:41 +0000</pubDate>
		<dc:creator>themeheven</dc:creator>
				<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[jquery plugins]]></category>

		<guid isPermaLink="false">http://www.themeheven.com/?p=110</guid>
		<description><![CDATA[1. jQuery BlockUI Plugin (v2)
The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser[1]. When activated, it will prevent user activity with the page (or part of the page) until it is deactivated. BlockUI adds elements to the DOM to give it both the appearance and behavior of blocking [...]]]></description>
			<content:encoded><![CDATA[<p>1.<a href="http://malsup.com/jquery/block/#overview" target="_blank"> jQuery BlockUI Plugin (v2)</a></p>
<p>The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser[1]. When activated, it will prevent user activity with the page (or part of the page) until it is deactivated. BlockUI adds elements to the DOM to give it both the appearance and behavior of blocking user interaction.</p>
<p>Usage is very simple; to block user activity for the page:</p>
<pre><code>$.blockUI();</code></pre>
<p>Blocking with a custom message:</p>
<pre><code>$.blockUI({ message: '&lt;h1&gt;&lt;img src="busy.gif" /&gt; Just a moment...&lt;/h1&gt;' });</code></pre>
<p><a href="http://malsup.com/jquery/block/#download" target="_blank">Download</a></p>
<p><a href="http://malsup.com/jquery/block/#overview" target="_blank">For More&#8230;</a></p>
<p>2. <a href="http://webrocket.ulmb.com/ability/" target="_blank">jQuery Accessibility Plugin</a></p>
<p>To use jQuery Accessibility Plugin &#8211; first you must have jQuery and the jQuery Cookie Plugin. This plugin has been tested with version 1.1.3 on FireFox2 on Ubuntu 7.04.</p>
<p>To initialise this, you need to include the JS files in your HTML header.</p>
<pre><code>&lt;script src="jquery.js"type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="jquery.cookie.js"type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="jquery.ability.js"type="text/javascript"&gt;&lt;/script&gt;</code></pre>
<p><a href="http://webrocket.ulmb.com/ability/#download" target="_blank">Download</a></p>
<p><a href="http://webrocket.ulmb.com/ability/" target="_blank">For More&#8230; </a></p>
<p>3.<a href="http://bassistance.de/jquery-plugins/jquery-plugin-accordion/" target="_blank"> jQuery accordion Plugin</a></p>
<p><a href="http://bassistance.de/jquery-plugins/jquery-plugin-accordion/" target="_blank"><img src="http://imagesho.comuv.com/jqueryplugin/accordion.gif" border="0" alt="" width="500" height="299" /></a></p>
<p>This plugin creates an accordion menu. It works with nested lists, definition lists, or just nested divs. Options are available to specify the structure, if necessary, the active element (to display at first) and to customize animations. The navigation-option automatically activates a part of the accordion based on the current location (URL) of the page.</p>
<pre><code>jQuery('#list1a').accordion(); 

  jQuery('#list1b').accordion({ 

autoheight: false 

});</code></pre>
<p><a href="http://jquery.bassistance.de/accordion/jquery.accordion.zip" target="_blank">Download</a></p>
<p><a href="http://bassistance.de/jquery-plugins/jquery-plugin-accordion/" target="_blank">Read More&#8230;</a></p>
<p>4.<a href="http://medienfreunde.com/lab/innerfade/" target="_blank"> InnerFade with JQuery</a></p>
<p>InnerFade is a small plugin for the<a href="http://jquery.com/" target="_blank"> jQuery-JavaScript-Library</a>. It&#8217;s designed to fade you any element inside a container in and out.</p>
<p>These elements could be anything you want, e.g. images, list-items, divs. Simply produce your own slideshow for your portfolio or advertisings. Create a newsticker or do an animation.</p>
<p><a href="http://medienfreunde.com/lab/innerfade/" target="_blank"><img src="http://imagesho.comuv.com/jqueryplugin/ggbg.gif" border="0" alt="" width="638" height="220" /></a></p>
<pre><code>$('ID or class of the element containing the fading objects').innerfade({
	animationtype: Type of animation 'fade' or 'slide' (Default: 'fade'),
	speed: Fadingspeed in milliseconds or keywords (slow, normal or fast)(Default: 'normal'),
	timeout: Time between the fades in milliseconds (Default: '2000'),
	type: Type of slideshow: 'sequence', 'random' or 'random_start' (Default: 'sequence'),
	containerheight: Height of the containing element in any css-height-value (Default: 'auto')
	runningclass: CSS-Class which the container get’s applied (Default: 'innerfade')
});
</code></pre>
<p>A list with images and links.</p>
<pre><code>&lt;ul id="portfolio"&gt;
&lt;li&gt;
&lt;a href="http://medienfreunde.com/deutsch/referenzen/kreation/good_guy__bad_guy.html"&gt;
&lt;img src="images/ggbg.gif" alt="Good Guy bad Guy" /&gt;
&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://medienfreunde.com/deutsch/referenzen/kreation/whizzkids.html"&gt;
&lt;img src="images/whizzkids.gif" alt="Whizzkids" /&gt;
&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://medienfreunde.com/deutsch/referenzen/printdesign/koenigin_mutter.html"&gt;
&lt;img src="images/km.jpg" alt="Königin Mutter" /&gt;
&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://medienfreunde.com/deutsch/referenzen/webdesign/rt_reprotechnik_-_hybride_archivierung.html"&gt;
&lt;img src="images/rt_arch.jpg" alt="RT Hybride Archivierung" /&gt;
&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://medienfreunde.com/deutsch/referenzen/kommunikation/tuev_sued_gruppe.html"&gt;
&lt;img src="images/tuev.jpg" alt="TÜV SÜD Gruppe" /&gt;
&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
<p><a href="http://medienfreunde.com/lab/innerfade/" target="_blank">For More&#8230;</p>
<p></a></p>
<p><a href="http://medienfreunde.com/stats/getfile.php?id=3" target="_blank">Download</a></p>
<p>5.<a href="http://malsup.com/jquery/gfeed/" target="_blank"> jQuery Google Feed Plugin</a></p>
<p>On April 16th, 2007, <a href="http://googleajaxsearchapi.blogspot.com/2007/04/announcing-google-ajax-feed-api.html" target="_blank">Google announced </a>the Google AJAX Feed API. This is a pretty cool thing as it facilitates feed mashups by providing the server component. This means that developers can easily mash feeds on the client by simply including Google&#8217;s new API script. And Google has provided a nice<a href="http://code.google.com/apis/ajaxfeeds/documentation/" target="_blank"> Developer&#8217;s Guide</a> which shows how to get started.</p>
<p>To simplify this even more for jQuery developers, I&#8217;ve created a small plugin which performs the task of unobtrusively converting an element, such as an &lt;a&gt;, into a &lt;div&gt; element which holds feed content.</p>
<pre><code>$(document).ready(function() {
    // add a feed manually
    $('#alistapart').gFeed({
        url: 'http://www.alistapart.com/feed/rss.xml',
        title: 'A List Apart Feed (Added by Brute Force)'
    });
}); </code></pre>
<p><a href="http://malsup.com/jquery/gfeed/jquery.gfeed.js" target="_blank">Download </a></p>
<p><a href="http://malsup.com/jquery/gfeed/" target="_blank">More&#8230;</a></p>
<p>6.<a href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank"> jQuery Easing Plugin </a></p>
<p>A jQuery plugin from GSGD to give advanced easing options.</p>
<pre><code>$(element).slideUp(1000, method, callback});
$(element).slideUp({
	duration: 1000,
	easing: method,
	complete: callback});</code></pre>
<p><strong>Download</strong></p>
<p><a href="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js" target="_blank">jquery.easing.1.3.js</a></p>
<p><a href="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.compatibility.js" target="_blank">jquery.easing.compatibility.js</a></p>
<p><a href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank">Read More&#8230; </a></p>
<p>7.<a href="http://malsup.com/jquery/form/#getting-started" target="_blank"> jQuery Form Plugin</a></p>
<p>The jQuery Form Plugin allows you to easily and unobtrusively upgrade HTML forms to use AJAX. The main methods, ajaxForm and ajaxSubmit, gather information from the form element to determine how to manage the submit process. Both of these methods support numerous options which allows you to have full control over how the data is submitted. Submitting a form with AJAX doesn&#8217;t get any easier than this!</p>
<pre><code>&lt;form id="myForm" action="comment.php" method="post"&gt; 

Name: &lt;input type="text" name="name" /&gt; 

Comment: &lt;textarea name="comment"&gt;&lt;/textarea&gt;
&lt;input type="submit" value="Submit Comment" /&gt;
&lt;/form&gt;</code></pre>
<p><a href="http://malsup.com/jquery/form/jquery.form.js?2.24" target="_blank">Download</a></p>
<p><a href="http://malsup.com/jquery/form/#getting-started" target="_blank">Read More.. </a></p>
<p>8.<a href="http://malsup.com/jquery/hoverpulse/" target="_blank"> hoverpulse</a></p>
<p>This article shows a little plugin called &#8216;hoverpulse&#8217; which grows and then restores an element&#8217;s size in response to the mouse hovering over it.</p>
<p><a href="http://malsup.com/jquery/hoverpulse/" target="_blank"><img src="http://imagesho.comuv.com/jqueryplugin/hoverplus.gif" border="0" alt="" width="278" height="225" /></a></p>
<pre><code>$(document).ready(function() {
    $('div.thumb img').hoverpulse();
});</code></pre>
<p><a href="http://malsup.com/jquery/hoverpulse/jquery.hoverpulse.js" target="_blank">Download</a></p>
<p><a href="http://malsup.com/jquery/hoverpulse/" target="_blank">Read More&#8230;</a></p>
<p>9. <a href="http://malsup.com/jquery/media/#overview" target="_blank">jQuery Media Plugin</a></p>
<p>The jQuery Media Plugin supports unobtrusive conversion of standard markup into rich media content. It can be used to embed virtually any media type, including Flash, Quicktime, Windows Media Player, Real Player, MP3, Silverlight, PDF and more, into a web page. The plugin converts an element (usually an &lt;a&gt;) into a &lt;div&gt; which holds the object, embed or iframe tags neccessary to render the media content.</p>
<pre><code>$('.media').media();</code></pre>
<p><a href="http://malsup.com/jquery/media/#download" target="_blank">Download</a></p>
<p><a href="http://malsup.com/jquery/media/#overview" target="_blank">Read More&#8230;</a></p>
<p>10. <a href="http://malsup.com/jquery/corner/" target="_blank">jQuery Corner</a></p>
<p>Corner adorners are all the rage in web design these days. Designers say that plain old right-angle corners are so Web 1.0 now. However, some of the techniques to take the edge off corners use extra markup that is only there to support the decoration, which violates the separation of content and presentation. Now that&#8217;s really Web 1.0 so we don&#8217;t want to go there. Others use single-purpose rounded corner images or bulky Javascript code; that seems like a high price to pay for beauty.</p>
<p><a href="http://malsup.com/jquery/corner/" target="_blank"><img src="http://imagesho.comuv.com/jqueryplugin/corner.gif" border="0" alt="" width="500" height="200" /></a></p>
<pre><code>$(this).corner("round 8px").parent().css('padding', '4px').corner("round 10px")</code></pre>
<p><a href="http://malsup.com/jquery/corner/jquery.corner.js" target="_blank">Download</a></p>
<p><a href="http://methvin.com/jquery/jq-corner.html" target="_blank">Read More&#8230;</a></p>
<p>11.<a href="http://malsup.com/jquery/taconite/#overview" target="_blank"> jQuery Taconite Plugin</a></p>
<p>The jQuery Taconite Plugin allows you to easily make multiple DOM updates using the results of a single AJAX call. It processes an XML command document that contain instructions for updating the DOM.</p>
<pre><code>$('#status').append('Your order has shipped');</code></pre>
<p><a href="http://malsup.com/jquery/taconite/#download" target="_blank">Download</a></p>
<p><a href="http://malsup.com/jquery/taconite/#overview" target="_blank">Read More&#8230;</a></p>
<p>12.  <a href="http://benjaminsterling.com/jquery-jqgalview-photo-gallery/" target="_blank">jQuery jqGalView</a></p>
<p>The jQuery jqGalView Plugin allows you to take a grouping of images and turn it into an flash-like image/photo gallery. It allows you to style it how ever you want and add as many images at you want.</p>
<p><a href="http://benjaminsterling.com/jquery-jqgalview-photo-gallery/" target="_blank"><img src="http://imagesho.comuv.com/jqueryplugin/photoviewer.gif" border="0" alt="" width="500" height="358" /></a></p>
<pre><code>&lt;ul id="example1" title="My Gallery"&gt;
&lt;li&gt;&lt;a href="PathToFullSizeImage"&gt;&lt;img src="PathToFullThumbnailImage" alt="Some alt text" width="144" height="96" border="0"/&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="PathToFullSizeImage"&gt;&lt;img src="PathToFullThumbnailImage" alt="Some alt text" width="144" height="96" border="0"/&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="PathToFullSizeImage"&gt;&lt;img src="PathToFullThumbnailImage" alt="Some alt text" width="144" height="96" border="0"/&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<p><a href="http://bs-jquery-plugins.googlecode.com/files/jqGalView.2.1.zip" target="_blank">Download</a></p>
<p><a href="http://benjaminsterling.com/jquery-jqgalview-photo-gallery/" target="_blank">Read More&#8230;</a></p>
<p>13. <a href="http://itgroup.com.ph/alphanumeric/" target="_blank">jQuery AlphaNumeric</a></p>
<p>Did you ever have the need to prevent users from entering certain characters into your form?</p>
<p>Looking at the plugins available at jQuery, I found a great plugin made by Sam Collet called <a href="http://www.texotela.co.uk/code/jquery/numeric/" target="_blank">Numeric</a>.</p>
<p>But it was too limited, what if I&#8217;m asking the user to create a username? Or what if I need to enter a number with decimals or an IP Address? There is another great plugin called <a href="http://digitalbush.com/projects/masked-input-plugin" target="_blank">Masked Input</a> by Josh Bush, which can also control user input by defining a mask. The problem however with that was the length of text to be inserted must be defined as well. Again, what if I needed to control input of a username? I can&#8217;t tell how many characters the user will be using, and I can&#8217;t force him to use just 8 characters ,so I created AlphaNumeric.</p>
<p>jQuery AlphaNumeric is a javascript control plugin that allows you to limit what characters a user can enter on textboxes or textareas. Have fun.</p>
<p><a href="http://itgroup.com.ph/alphanumeric/" target="_blank"><img src="http://imagesho.comuv.com/jqueryplugin/alpha.gif" border="0" alt="" width="500" height="144" /></a></p>
<p><a href="http://itgroup.com.ph/alphanumeric/alphanumeric.zip" target="_blank">Download</a></p>
<p><a href="http://itgroup.com.ph/alphanumeric/" target="_blank">Read More</a>&#8230;</p>
<p>14. <a href="http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding" target="_blank">Easy Slider 1.5.</a></p>
<p>The Easiest jQuery Plugin For Sliding Images and Content. New version of my Easy Slider plugin for jQuery is here. This is one of the my rare scripts that make it to their second version. In this case version 1.5</p>
<p>All of the features here are result of your comments, so if you have more ideas, keep &#8216;em coming!</p>
<p><a href="http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding" target="_blank"><img src="http://imagesho.comuv.com/jqueryplugin/slider.gif" border="0" alt="" width="500" height="212" /></a></p>
<p><a href="http://cssglobe.com/lab/easyslider1.5/easySlider1.5.zip" target="_blank">Download</a></p>
<p><a href="http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding" target="_blank">Read More&#8230;</a></p>
<p>15. <a href="http://www.mind-projects.it/projects/jqzoom/" target="_blank">jqZoom Evolution</a></p>
<p>JQZoom is a javascript image magnifier built at the top of the popular jQuery javascript framework.jQzoom is a great and a really easy to use script to magnify what you want.</p>
<p><img src="http://imagesho.comuv.com/jqueryplugin/zoom.gif" alt="" width="500" height="215" /></p>
<pre><code>var options =
            {
                zoomWidth: 250,
                zoomHeight: 250
            }
            $(".jqzoom").jqzoom(options);</code></pre>
<p><a href="http://www.mind-projects.it/projects/jqzoom/archives/jqzoom_ev1.0.1.zip" target="_blank">Download</a></p>
<p><a href="http://www.mind-projects.it/projects/jqzoom/" target="_blank">Read More&#8230; </a></p>
<p>16.<a href="http://dyve.net/jquery/?autocomplete" target="_blank"> autocomplete</a></p>
<p>A jQuery autocompleter with caching options to limit server requests.</p>
<p>Please also look at the <a href="http://www.dyve.net/jquery/autocomplete.txt" target="_blank">documentation</a> (plain text, download or view).</p>
<p><strong>Source Code: </strong></p>
<pre><code>jQuery.autocomplete = function(input, options) {
	// Create a link to self
	var me = this;

	// Create jQuery object for input element
	var $input = $(input).attr("autocomplete", "off");

	// Apply inputClass if necessary
	if (options.inputClass) {
		$input.addClass(options.inputClass);
	}

	// Create results
	var results = document.createElement("div");

	// Create jQuery object for results
	// var $results = $(results);
	var $results = $(results).hide().addClass(options.resultsClass).css("position", "absolute");
	if( options.width &gt; 0 ) {
		$results.css("width", options.width);
	}

	// Add to body element
	$("body").append(results);

	input.autocompleter = me;

	var timeout = null;
	var prev = "";
	var active = -1;
	var cache = {};
	var keyb = false;
	var hasFocus = false;
	var lastKeyPressCode = null;
	var mouseDownOnSelect = false;
	var hidingResults = false;

	// flush cache
	function flushCache(){
		cache = {};
		cache.data = {};
		cache.length = 0;
	};

	// flush cache
	flushCache();

	// if there is a data array supplied
	if( options.data != null ){
		var sFirstChar = "", stMatchSets = {}, row = [];

		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
		if( typeof options.url != "string" ) {
			options.cacheLength = 1;
		}

		// loop through the array and create a lookup structure
		for( var i=0; i &lt; options.data.length; i++ ){
			// if row is a string, make an array otherwise just reference the array
			row = ((typeof options.data[i] == "string") ? [options.data[i]] : options.data[i]);

			// if the length is zero, don't add to list
			if( row[0].length &gt; 0 ){
				// get the first character
				sFirstChar = row[0].substring(0, 1).toLowerCase();
				// if no lookup array for this character exists, look it up now
				if( !stMatchSets[sFirstChar] ) stMatchSets[sFirstChar] = [];
				// if the match is a string
				stMatchSets[sFirstChar].push(row);
			}
		}

		// add the data items to the cache
		for( var k in stMatchSets ) {
			// increase the cache size
			options.cacheLength++;
			// add to the cache
			addToCache(k, stMatchSets[k]);
		}
	}

	$input
	.keydown(function(e) {
		// track last key pressed
		lastKeyPressCode = e.keyCode;
		switch(e.keyCode) {
			case 38: // up
				e.preventDefault();
				moveSelect(-1);
				break;
			case 40: // down
				e.preventDefault();
				moveSelect(1);
				break;
			case 9:  // tab
			case 13: // return
				if( selectCurrent() ){
					// make sure to blur off the current field
					$input.get(0).blur();
					e.preventDefault();
				}
				break;
			default:
				active = -1;
				if (timeout) clearTimeout(timeout);
				timeout = setTimeout(function(){onChange();}, options.delay);
				break;
		}
	})
	.focus(function(){
		// track whether the field has focus, we shouldn't process any results if the field no longer has focus
		hasFocus = true;
	})
	.blur(function() {
		// track whether the field has focus
		hasFocus = false;
		if (!mouseDownOnSelect) {
			hideResults();
		}
	});

	hideResultsNow();

	function onChange() {
		// ignore if the following keys are pressed: [del] [shift] [capslock]
		if( lastKeyPressCode == 46 || (lastKeyPressCode &gt; 8 &amp;&amp; lastKeyPressCode &lt; 32) ) return $results.hide();
		var v = $input.val();
		if (v == prev) return;
		prev = v;
		if (v.length &gt;= options.minChars) {
			$input.addClass(options.loadingClass);
			requestData(v);
		} else {
			$input.removeClass(options.loadingClass);
			$results.hide();
		}
	};

 	function moveSelect(step) {

		var lis = $("li", results);
		if (!lis) return;

		active += step;

		if (active &lt; 0) {
			active = 0;
		} else if (active &gt;= lis.size()) {
			active = lis.size() - 1;
		}

		lis.removeClass("ac_over");

		$(lis[active]).addClass("ac_over");

		// Weird behaviour in IE
		// if (lis[active] &amp;&amp; lis[active].scrollIntoView) {
		// 	lis[active].scrollIntoView(false);
		// }

	};

	function selectCurrent() {
		var li = $("li.ac_over", results)[0];
		if (!li) {
			var $li = $("li", results);
			if (options.selectOnly) {
				if ($li.length == 1) li = $li[0];
			} else if (options.selectFirst) {
				li = $li[0];
			}
		}
		if (li) {
			selectItem(li);
			return true;
		} else {
			return false;
		}
	};

	function selectItem(li) {
		if (!li) {
			li = document.createElement("li");
			li.extra = [];
			li.selectValue = "";
		}
		var v = $.trim(li.selectValue ? li.selectValue : li.innerHTML);
		input.lastSelected = v;
		prev = v;
		$results.html("");
		$input.val(v);
		hideResultsNow();
		if (options.onItemSelect) {
			setTimeout(function() { options.onItemSelect(li) }, 1);
		}
	};

	// selects a portion of the input string
	function createSelection(start, end){
		// get a reference to the input element
		var field = $input.get(0);
		if( field.createTextRange ){
			var selRange = field.createTextRange();
			selRange.collapse(true);
			selRange.moveStart("character", start);
			selRange.moveEnd("character", end);
			selRange.select();
		} else if( field.setSelectionRange ){
			field.setSelectionRange(start, end);
		} else {
			if( field.selectionStart ){
				field.selectionStart = start;
				field.selectionEnd = end;
			}
		}
		field.focus();
	};

	// fills in the input box w/the first match (assumed to be the best match)
	function autoFill(sValue){
		// if the last user key pressed was backspace, don't autofill
		if( lastKeyPressCode != 8 ){
			// fill in the value (keep the case the user has typed)
			$input.val($input.val() + sValue.substring(prev.length));
			// select the portion of the value not typed by the user (so the next character will erase)
			createSelection(prev.length, sValue.length);
		}
	};

	function showResults() {
		// get the position of the input field right now (in case the DOM is shifted)
		var pos = findPos(input);
		// either use the specified width, or autocalculate based on form element
		var iWidth = (options.width &gt; 0) ? options.width : $input.width();
		// reposition
		$results.css({
			width: parseInt(iWidth) + "px",
			top: (pos.y + input.offsetHeight) + "px",
			left: pos.x + "px"
		}).show();
	};

	function hideResults() {
		if (timeout) clearTimeout(timeout);
		timeout = setTimeout(hideResultsNow, 200);
	};

	function hideResultsNow() {
		if (hidingResults) {
			return;
		}
		hidingResults = true;

		if (timeout) {
			clearTimeout(timeout);
		}

		var v = $input.removeClass(options.loadingClass).val();

		if ($results.is(":visible")) {
			$results.hide();
		}

		if (options.mustMatch) {
			if (!input.lastSelected || input.lastSelected != v) {
				selectItem(null);
			}
		}

		hidingResults = false;
	};

	function receiveData(q, data) {
		if (data) {
			$input.removeClass(options.loadingClass);
			results.innerHTML = "";

			// if the field no longer has focus or if there are no matches, do not display the drop down
			if( !hasFocus || data.length == 0 ) return hideResultsNow();

			if ($.browser.msie) {
				// we put a styled iframe behind the calendar so HTML SELECT elements don't show through
				$results.append(document.createElement('iframe'));
			}
			results.appendChild(dataToDom(data));
			// autofill in the complete box w/the first match as long as the user hasn't entered in more data
			if( options.autoFill &amp;&amp; ($input.val().toLowerCase() == q.toLowerCase()) ) autoFill(data[0][0]);
			showResults();
		} else {
			hideResultsNow();
		}
	};

	function parseData(data) {
		if (!data) return null;
		var parsed = [];
		var rows = data.split(options.lineSeparator);
		for (var i=0; i &lt; rows.length; i++) {
			var row = $.trim(rows[i]);
			if (row) {
				parsed[parsed.length] = row.split(options.cellSeparator);
			}
		}
		return parsed;
	};

	function dataToDom(data) {
		var ul = document.createElement("ul");
		var num = data.length;

		// limited results to a max number
		if( (options.maxItemsToShow &gt; 0) &amp;&amp; (options.maxItemsToShow &lt; num) ) num = options.maxItemsToShow;

		for (var i=0; i &lt; num; i++) {
			var row = data[i];
			if (!row) continue;
			var li = document.createElement("li");
			if (options.formatItem) {
				li.innerHTML = options.formatItem(row, i, num);
				li.selectValue = row[0];
			} else {
				li.innerHTML = row[0];
				li.selectValue = row[0];
			}
			var extra = null;
			if (row.length &gt; 1) {
				extra = [];
				for (var j=1; j &lt; row.length; j++) {
					extra[extra.length] = row[j];
				}
			}
			li.extra = extra;
			ul.appendChild(li);

			$(li).hover(
				function() { $("li", ul).removeClass("ac_over"); $(this).addClass("ac_over"); active = $("li", ul).indexOf($(this).get(0)); },
				function() { $(this).removeClass("ac_over"); }
			).click(function(e) {
				e.preventDefault();
				e.stopPropagation();
				selectItem(this)
			});

		}
		$(ul).mousedown(function() {
			mouseDownOnSelect = true;
		}).mouseup(function() {
			mouseDownOnSelect = false;
		});
		return ul;
	};

	function requestData(q) {
		if (!options.matchCase) q = q.toLowerCase();
		var data = options.cacheLength ? loadFromCache(q) : null;
		// recieve the cached data
		if (data) {
			receiveData(q, data);
		// if an AJAX url has been supplied, try loading the data now
		} else if( (typeof options.url == "string") &amp;&amp; (options.url.length &gt; 0) ){
			$.get(makeUrl(q), function(data) {
				data = parseData(data);
				addToCache(q, data);
				receiveData(q, data);
			});
		// if there's been no data found, remove the loading class
		} else {
			$input.removeClass(options.loadingClass);
		}
	};

	function makeUrl(q) {
		var sep = options.url.indexOf('?') == -1 ? '?' : '&amp;';
		var url = options.url + sep + "q=" + encodeURI(q);
		for (var i in options.extraParams) {
			url += "&amp;" + i + "=" + encodeURI(options.extraParams[i]);
		}
		return url;
	};

	function loadFromCache(q) {
		if (!q) return null;
		if (cache.data[q]) return cache.data[q];
		if (options.matchSubset) {
			for (var i = q.length - 1; i &gt;= options.minChars; i--) {
				var qs = q.substr(0, i);
				var c = cache.data[qs];
				if (c) {
					var csub = [];
					for (var j = 0; j &lt; c.length; j++) {
						var x = c[j];
						var x0 = x[0];
						if (matchSubset(x0, q)) {
							csub[csub.length] = x;
						}
					}
					return csub;
				}
			}
		}
		return null;
	};

	function matchSubset(s, sub) {
		if (!options.matchCase) s = s.toLowerCase();
		var i = s.indexOf(sub);
		if (i == -1) return false;
		return i == 0 || options.matchContains;
	};

	this.flushCache = function() {
		flushCache();
	};

	this.setExtraParams = function(p) {
		options.extraParams = p;
	};

	this.findValue = function(){
		var q = $input.val();

		if (!options.matchCase) q = q.toLowerCase();
		var data = options.cacheLength ? loadFromCache(q) : null;
		if (data) {
			findValueCallback(q, data);
		} else if( (typeof options.url == "string") &amp;&amp; (options.url.length &gt; 0) ){
			$.get(makeUrl(q), function(data) {
				data = parseData(data)
				addToCache(q, data);
				findValueCallback(q, data);
			});
		} else {
			// no matches
			findValueCallback(q, null);
		}
	}

	function findValueCallback(q, data){
		if (data) $input.removeClass(options.loadingClass);

		var num = (data) ? data.length : 0;
		var li = null;

		for (var i=0; i &lt; num; i++) {
			var row = data[i];

			if( row[0].toLowerCase() == q.toLowerCase() ){
				li = document.createElement("li");
				if (options.formatItem) {
					li.innerHTML = options.formatItem(row, i, num);
					li.selectValue = row[0];
				} else {
					li.innerHTML = row[0];
					li.selectValue = row[0];
				}
				var extra = null;
				if( row.length &gt; 1 ){
					extra = [];
					for (var j=1; j &lt; row.length; j++) {
						extra[extra.length] = row[j];
					}
				}
				li.extra = extra;
			}
		}

		if( options.onFindValue ) setTimeout(function() { options.onFindValue(li) }, 1);
	}

	function addToCache(q, data) {
		if (!data || !q || !options.cacheLength) return;
		if (!cache.length || cache.length &gt; options.cacheLength) {
			flushCache();
			cache.length++;
		} else if (!cache[q]) {
			cache.length++;
		}
		cache.data[q] = data;
	};

	function findPos(obj) {
		var curleft = obj.offsetLeft || 0;
		var curtop = obj.offsetTop || 0;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
		return {x:curleft,y:curtop};
	}
}

jQuery.fn.autocomplete = function(url, options, data) {
	// Make sure options exists
	options = options || {};
	// Set url as option
	options.url = url;
	// set some bulk local data
	options.data = ((typeof data == "object") &amp;&amp; (data.constructor == Array)) ? data : null;

	// Set default values for required options
	options = $.extend({
		inputClass: "ac_input",
		resultsClass: "ac_results",
		lineSeparator: "\n",
		cellSeparator: "|",
		minChars: 1,
		delay: 400,
		matchCase: 0,
		matchSubset: 1,
		matchContains: 0,
		cacheLength: 1,
		mustMatch: 0,
		extraParams: {},
		loadingClass: "ac_loading",
		selectFirst: false,
		selectOnly: false,
		maxItemsToShow: -1,
		autoFill: false,
		width: 0
	}, options);
	options.width = parseInt(options.width, 10);

	this.each(function() {
		var input = this;
		new jQuery.autocomplete(input, options);
	});

	// Don't break the chain
	return this;
}

jQuery.fn.autocompleteArray = function(data, options) {
	return this.autocomplete(null, options, data);
}

jQuery.fn.indexOf = function(e){
	for( var i=0; i&lt;this.length; i++ ){
		if( this[i] == e ) return i;
	}
	return -1;
};
</code></pre>
<p><a href="http://dyve.net/jquery/?autocomplete" target="_blank">Read More&#8230;</a></p>
<p>17. <a href="http://rikrikrik.com/jquery/quicksearch/" target="_blank">jQuery quickSearch plug-in</a></p>
<p>For Search</p>
<pre><code>$('table#table_example tbody tr').quicksearch({
  position: 'before',
  attached: 'table#table_example',
  stripeRowClass: ['odd', 'even'],
  labelText: 'Search the table'
});</code></pre>
<p><a href="http://rikrikrik.com/jquery/quicksearch/#download" target="_blank">Download</a></p>
<p><a href="http://rikrikrik.com/jquery/quicksearch/" target="_blank">Read More&#8230;</a></p>
<p>18.<a href="http://rikrikrik.com/jquery/autosave/" target="_blank"> jQuery autosave plug-in</a></p>
<p>Autosave is designed to save the progress of forms by saving the fields to cookies so you won’t lose anything should anything go wrong</p>
<p>The plug-in saves the form fields at certain intervals (the default is every 10 seconds) and whenever you leave the page.</p>
<p>The plug-in was written with work-intensive forms in mind, such as a blog article writing form.</p>
<pre><code>$('form *').autosave();</code></pre>
<p><a href="http://rikrikrik.com/jquery/autosave/#download" target="_blank">Download</a></p>
<p><a href="http://rikrikrik.com/jquery/autosave/" target="_blank">Read More&#8230;</a></p>
<p>19. <a href="http://wanderinghorse.net/computing/javascript/jquery/bogofolders/" target="_blank">BogoFolders jQuery Plugin</a></p>
<p>The BogoFolders plugin provides a filemanager-like view of trees of items. It shows the user a selectable list of &#8220;folder&#8221; icons. Clicking an icon shows the content associated with it in a separate HTML element and (if the item has child elements) it &#8220;changes the directory&#8221; to that item, similarly to how a file manager works. It is believed to work as advertised with jQuery 1.1.3, 1.1.4, and 1.2.0.</p>
<p><a href="http://wanderinghorse.net/computing/javascript/jquery/bogofolders/" target="_blank">Download</a></p>
<p><a href="http://wanderinghorse.net/computing/javascript/jquery/bogofolders/" target="_blank">Read More&#8230;</a></p>
<p>20. <a href="http://p.sohei.org/jquery-plugins/menu/" target="_blank">jQuery Menu plugin</a></p>
<p>A jQuery menu plugin. It’s a drop down menu, which behaves like an application menu (click to open, click to close, stays open even after hovering elsewhere). It supports menu creation through HTML markup or through JavaScript. The plugin tries to position its submenus inside the visible area when there is not enough space at the right or bottom border (dimensions plugin required).</p>
<pre><code>	var options = {minWidth: 120, arrowSrc: 'arrow_right.gif', onClick: function(e, menuItem){
		alert('you clicked item "' + $(this).text() + '"');
	}};
	$('#menuone').menu(options);
</code></pre>
<p><a href="http://p.sohei.org/download-manager.php?id=57" target="_blank">Download</p>
<p></a></p>
<p><a href="http://p.sohei.org/jquery-plugins/menu/" target="_blank">Read More&#8230;</a></p>
<p>21.<a href="http://rikrikrik.com/jquery/pager/" target="_blank"> jQuery pager plug-in</a></p>
<p>For use in more than one pagers per page, takes a string. Default ‘nav’</p>
<pre><code>$('#example1').pager('div');</code></pre>
<p><a href="http://rikrikrik.com/jquery/pager/#download" target="_blank">Download</a></p>
<p><a href="http://rikrikrik.com/jquery/pager/" target="_blank">Read More&#8230; </a></p>
<p>22.<a href="http://plugins.learningjquery.com/cluetip/" target="_blank"> clueTip : A jQuery Plugin</a></p>
<p>The clueTip plugin allows you to easily show a fancy tooltip when the user&#8217;s mouse hovers over (or, optionally, clicks on) any element you designate in your script. If the element includes a title attribute, its text becomes the heading of the clueTip.</p>
<pre><code>$('a.title').cluetip({splitTitle: '|'});</code></pre>
<p><a href="http://plugins.learningjquery.com/cluetip/#download" target="_blank">Download</a></p>
<p><a href="http://plugins.learningjquery.com/cluetip/" target="_blank">Read More &#8230;</a><br />
<h3>Most Commented Posts</h3>
<ul class="related_post">
<li><a href="http://www.themeheven.com/2009/03/display-wordpress-content-outside-of-your-blog/" title="Display Wordpress content outside of your blog">Display Wordpress content outside of your blog</a></li>
<li><a href="http://www.themeheven.com/2009/03/top-10-magazine-wordpress-themes-from-premiumthemes/" title="Top 10 Magazine WordPress Themes from Premiumthemes">Top 10 Magazine WordPress Themes from Premiumthemes</a></li>
<li><a href="http://www.themeheven.com/2009/04/wordpress-meta-tags-plugin/" title="WordPress Meta-Tags Plugin">WordPress Meta-Tags Plugin</a></li>
<li><a href="http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/" title="Simple JQuery Image Slide Show with Semi-Transparent Caption">Simple JQuery Image Slide Show with Semi-Transparent Caption</a></li>
<li><a href="http://www.themeheven.com/2009/06/web-2-0-and-seo/" title="Web 2.0 and SEO">Web 2.0 and SEO</a></li>
<li><a href="http://www.themeheven.com/2009/03/photoshop-tutorial-sites/" title="Photoshop Tutorial Sites">Photoshop Tutorial Sites</a></li>
<li><a href="http://www.themeheven.com/2009/04/how-to-embed-google-ad-in-your-post/" title="How to: Embed Google Ad in your post">How to: Embed Google Ad in your post</a></li>
<li><a href="http://www.themeheven.com/2009/04/wordpress-tips-and-tricks/" title="Wordpress Tips and Tricks">Wordpress Tips and Tricks</a></li>
<li><a href="http://www.themeheven.com/2009/04/digital-photography-tutorial-and-tips/" title="Digital Photography Tutorial and Tips">Digital Photography Tutorial and Tips</a></li>
<li><a href="http://www.themeheven.com/2009/05/useful-wordpress-tricks-to-make-your-theme-even-better/" title="Useful Wordpress Tricks to Make Your Theme Even Better">Useful Wordpress Tricks to Make Your Theme Even Better</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.themeheven.com/2009/04/22-useful-jquery-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Jquery Slider</title>
		<link>http://www.themeheven.com/2009/04/10-jquery-slider/</link>
		<comments>http://www.themeheven.com/2009/04/10-jquery-slider/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 09:53:41 +0000</pubDate>
		<dc:creator>themeheven</dc:creator>
				<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Jquery Slider]]></category>
		<category><![CDATA[Slider]]></category>

		<guid isPermaLink="false">http://www.themeheven.com/?p=108</guid>
		<description><![CDATA[1. Revealing Photo Slider
So in my journey to to learn jQuery, I’m trying to learn to do some things that CSS can already do but that jQuery can do “sexier”. Jonathan Snook has an article up “Content Overlay with CSS” in which extra content is revealed in a certain area when it is moused over. [...]]]></description>
			<content:encoded><![CDATA[<p>1. <a href="http://css-tricks.com/revealing-photo-slider/" target="_blank">Revealing Photo Slider</a></p>
<p>So in my journey to to learn jQuery, I’m trying to learn to do some things that CSS can already do but that jQuery can do “sexier”. Jonathan Snook has an article up “Content Overlay with CSS” in which extra content is revealed in a certain area when it is moused over. This inspired me to try to do something similar with jQuery. My first thought was a thumbnail photo gallery, where clicking a button would reveal the entire photo and more information about that photo. Here is the result:</p>
<p><a href="http://css-tricks.com/revealing-photo-slider/" target="_blank"><img src="http://imagesho.comuv.com/jqueryslider/revealing.gif" border="0" alt="" width="500" height="275" /></a></p>
<p><a href="http://css-tricks.com/revealing-photo-slider/" target="_blank">Read Original Post </a></p>
<p>2.<a href="http://blog.dmbcllc.com/2009/03/12/jquery-using-slider-as-a-scrollbar/" target="_blank"> jQuery &#8211; Using Slider as a Scrollbar</a></p>
<p>Last week I introduced the jQuery UI element known as a slider and indicated that this control could easily be used as a custom scrollbar.</p>
<p>Today I’m going to show you exactly how that’s done.</p>
<p>First we need to adjust our HTML. We need to add a content area to the HTML we had last week. I’m going to put this content area to the right of the scrollbar, but you could put it to the left by simply changing the CSS.</p>
<pre><code>  &lt;div id="slider"&gt;&lt;/div&gt;    &lt;div id="scroller"&gt;&lt;div id="content"&gt;    here is lots of text&lt;br /&gt;    &lt;/div&gt;&lt;/div&gt;</code></pre>
<p>The CSS to position this all correctly looks like this:</p>
<pre><code>
#slider
{
    height: 242px;
    width: 13px;
    margin:0px 10px 0px 10px;
    float:left;
}
#scroller
{
    width: 1159px;
    height: 243px;
    overflow:hidden;
}
#content
{
    width: 215px;
}</code></pre>
<p><a href="http://blog.dmbcllc.com/2009/03/12/jquery-using-slider-as-a-scrollbar/" target="_blank">Read Original Post </a></p>
<p>3.<a href="http://blog.dmbcllc.com/2009/03/23/jquery-auto-scrolling-the-slider/" target="_blank"> jQuery &#8211; Auto Scrolling the Slider</a></p>
<p>There is a timer plugin available for jQuery that will do some of the work for you, but all we really need for this functionality is:</p>
<ul>
<li> A function to do the auto incrementing</li>
<li> A call to the javascript setTimeout() function.</li>
</ul>
<p>So first, the auto incrementing function.</p>
<pre><code>function scrollWindow() {

 var slideValue;
  slideValue = $("#slider").slider("value");
  if(slideValue &gt; -100)
  {
  $("#slider").slider("value", slideValue - 1);
  setTimeout(scrollWindow, 1000);
  }
  }</code></pre>
<p><a href="http://blog.dmbcllc.com/2009/03/23/jquery-auto-scrolling-the-slider/" target="_blank">Read Original Post </a></p>
<p>4. <a href="http://interface.eyecon.ro/docs/slider" target="_blank">Slider</a></p>
<p>Creates vertical, horizontal or rectacle sliders with one or more indicators.</p>
<p><a href="http://interface.eyecon.ro/docs/slider" target="_blank"><img src="http://imagesho.comuv.com/jqueryslider/interface.gif" border="0" alt="" width="437" height="406" /></a></p>
<p>Code sample:</p>
<pre><code>$('.slider1').Slider(
{
accept : '.indicator',
fractions : 4,
onSlide : function( cordx, cordy, x , y)
{
document.getElementById('cordx').value = cordx + '%';
document.getElementById('cordy').value = cordy + '%';
},
values: [
[70,70]
]
}
);</code></pre>
<p><a href="http://interface.eyecon.ro/docs/slider" target="_blank">Read Original Post </a></p>
<p>5. <a href="http://www.keepthewebweird.com/creating-a-nice-slider-with-jquery-ui/" target="_blank">Creating a Nice Slider With jQuery UI</a></p>
<p>Sliders have many things going for them as a UI element; they offer the benefit restricting the choice a user has, without taking up the space of a drop down. If you need to ask the user to select a number between a range, you can either do an input box with validation, a drop down select element listing each possibility, or you can do a slider.</p>
<p>One drawback of a slider is the user not knowing what he’s selected as there’s no discrete output. If you are sliding to scale something, you can eyeball something, but wouldn’t it be nice if the slider provided some feedback to the user (”50%”) as the user was fiddling with it? I’m going to show you how to do just that with the jQuery UI library.</p>
<p>The HTML</p>
<pre><code>&lt;div id='container'&gt;
&lt;div class="slider_container"&gt;
&lt;div class='small_label'&gt;&lt;/div&gt;
&lt;div class='slider_bar'&gt;
&lt;div id="slider_callout"&gt;&lt;/div&gt;
&lt;div id='slider1_handle' class='slider_handle'&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class='large_label'&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt; </code></pre>
<p>CSS</p>
<pre><code>body { background: #284a6e; }
#container { height: 100px; border: 1px solid #284a6e;}
.slider_container { position: relative; margin-top: 50px; height: 40px;}
.small_label { background: url(minus.gif) no-repeat; height: 19px; width: 19px; overflow: hidden; float: left; }
.slider_bar { background: url(bar.gif) no-repeat; height: 19px; width: 260px;  float: left; margin: 0px 5px; position: relative;}
.large_label { background: url(plus.gif) no-repeat; height: 19px; width: 19px; overflow: hidden; float: left; }
.slider_handle { background: url(selector.png) no-repeat; height: 19px; width: 20px; overflow: hidden; position: absolute; top: 1px;}
#slider_callout { background: url(callout.gif) no-repeat; height: 45px; width: 38px; overflow: hidden; position: absolute; top: -50px; margin-left:-10px;  padding: 8px 0px 0px 0px; font-family: "Myriad Pro"; color: #284a6e; font-weight: bold; text-align: center;} </code></pre>
<p>Javascript</p>
<pre><code>
  $(function() {
    $('#slider_callout').hide();
    var calloutVisible = false;
    $('.slider_bar').slider({
        handle: '.slider_handle',
        minValue: 0, 

        maxValue: 25,
        start: function(e, ui) {
            $('#slider_callout').fadeIn('fast', function() { calloutVisible = true;});
        },
        stop: function(e, ui) {
            if (calloutVisible == false) {
                $('#slider_callout').fadeIn('fast', function() { calloutVisible = true;});
                $('#slider_callout').css('left', ui.handle.css('left')).text(Math.round(ui.value));
            }
            $('#slider_callout').fadeOut('fast', function() { calloutVisible = false; });
        },
        slide: function(e, ui) {
            $('#slider_callout').css('left', ui.handle.css('left')).text(Math.round(ui.value));
        }
    });
});
</code></pre>
<p><a href="http://www.keepthewebweird.com/creating-a-nice-slider-with-jquery-ui/" target="_blank">Read Original Post</p>
<p></a></p>
<p>6. <a href="http://www.reindel.com/accessible_news_slider/" target="_blank">Accessible News Slider</a></p>
<p>Accessible News Slider is a JavaScript plugin built for the jQuery library.<br />
It meets the accessibility requirements as outlined by <a href="http://www.w3.org/TR/WAI-WEBCONTENT/" target="_blank">WCAG 1.0.</a></p>
<p><img src="http://imagesho.comuv.com/jqueryslider/accessiblenewsslider.gif" alt="" width="500" height="200" /></p>
<p><a href="http://www.reindel.com/accessible_news_slider/" target="_blank">Read Article</a></p>
<p>7.<a href="http://wnas.nl/jquery-ui-slider" target="_blank"> jQuery UI slider</a></p>
<p>The past few weeks I had a lot of fun playing with jQuery UI for a client. They wanted to replace some elements in an application, sliders and such, with a more accessible solution. For that I turned to jQuery UI, as I had previously introduced jQuery as the standard javascript library for them.</p>
<p>As I started to play with the code I couldn&#8217;t helped but be impressed by the great work that has been done by the UI team on this project. But as I looked at it more closely I found some things that could be improved.</p>
<p>So here are some of my grieves with it and a possible way to solve them. I am going to concentrate on the slider ( docs / demo ), as it was with that widget that I started to notice some things missing.</p>
<p>The way you use it is in a true jquery fashion nice and unobtrusive, once you have included the correct javascript files (for that see the documentation), you just do:</p>
<pre><code>$("#slider").slider();</code></pre>
<p><a href="http://wnas.nl/jquery-ui-slider" target="_blank"> Read Original Post</a></p>
<p>8. <a href="http://cssglobe.com/post/3783/jquery-plugin-easy-image-or-content-slider" target="_blank">jQuery plugin &#8211; Easy Image or Content Slider</a></p>
<p>Easy Slider (as I call this plugin) enables images or any content to slide horizontally or vertically on click. It is configurable with css alone. So, basically you link to plugin file, set the content up and style it with css.</p>
<p><a href="http://cssglobe.com/lab/easyslider/easySlider.zip" target="_blank">Download Easy Slider zip</a></p>
<p>First you&#8217;ll need content and it should be wrapped inside a div containing an ordered list where each list item represents one slide. Here&#8217;s a markup example:</p>
<pre><code>
<div id="slider">
<ul>
<li>content here...</li>
<li>content here...</li>
<li>content here...</li>

...</ul>
</div>

</code></pre>
<p><a href="http://cssglobe.com/post/3783/jquery-plugin-easy-image-or-content-slider" target="_blank">Read Original Post</a></p>
<p>9.  	<a href="http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div" target="_blank">Using jQuery Slider to Scroll a Div</a></p>
<p>To get this started go ahead and check out the little demo below. There isn&#8217;t anything real hard to figure out with the demo. One nicety to check out is the ability to click on the scroll bar anywhere and the div will do an animated scroll to that position. Just as a note, I have noticed a small bug with the jQuery slider where it doesn&#8217;t always get the end position correct when you click on the scroll bar. Well, take a second and bask in the glory of the scrolling area below.</p>
<p><a href="http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div" target="_blank"><img src="http://imagesho.comuv.com/jqueryslider/scrolldiv.gif" border="0" alt="" width="500" height="310" /></a></p>
<p>Ok, now let&#8217;s get coding. We are first going to start with the basic html setup of the demo above. This shouldn&#8217;t look like anything crazy. The first element I pretty much always add to wrap my content is a div. We then setup the slider divs which is simply the sliderbar div and the handle div. Next up is a div to scroll and inside a div wide enough to hold the content. And lastly the content, which in my case is a bunch of divs. This ends up looking like the following (minus the content).</p>
<pre><code>&lt;div id="main"&gt;&lt;div id="content-slider"&gt;&lt;div class="content-slider-handle"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="content-scroll"&gt;  &lt;div id="content-holder"&gt;    &lt;div class="content-item"&gt;    &lt;/div&gt;    &lt;div class="content-item"&gt;    &lt;/div&gt;    &lt;div class="content-item"&gt;    &lt;/div&gt;    &lt;div class="content-item"&gt;    &lt;/div&gt;    &lt;div class="content-item"&gt;    &lt;/div&gt;  &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</code></pre>
<p><a href="http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div" target="_blank">Read Original Post</a></p>
<p>10. <a href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html" target="_blank">slideViewer (a jQuery image slider built on a single unordered list) 1.1</a></p>
<p><strong>What&#8217;s this?</strong> slideViewer is a lightweight (1.5Kb) jQuery plugin wich allows to instantly create an image gallery by writing just few lines of HTML such as an unordered list of images:</p>
<p><a href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html" target="_blank"><img src="http://imagesho.comuv.com/jqueryslider/photoslider.gif" border="0" alt="" width="500" height="291" /></a></p>
<p><a href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/jquery.slideviewer.1.1.js" target="_blank">Download slideViewer 1.1</a> (last updated january 14 2009)</p>
<pre><code>&lt;div id="mygalleryinpost10.12.2006" class="svw"&gt;     &lt;ul&gt;         &lt;li&gt;&lt;img src="picts/10.jpg" alt="my description for this image" /&gt;&lt;/li&gt;                 &lt;li&gt;&lt;img src="picts/08.jpg" alt="this is my dog..." /&gt;&lt;/li&gt;                 &lt;li&gt;&lt;img src="picts/03.jpg" alt="my dog eating the cat" /&gt;&lt;/li&gt;                 &lt;li&gt;&lt;img src="picts/05.jpg" alt="my r/c helicopter crashing..." /&gt;&lt;/li&gt;                 &lt;!--eccetera--&gt;     &lt;/ul&gt; &lt;/div&gt; </code></pre>
<p><a href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html" target="_blank">Read Original Post</a><br />
<h3>Most Commented Posts</h3>
<ul class="related_post">
<li><a href="http://www.themeheven.com/2009/03/display-wordpress-content-outside-of-your-blog/" title="Display Wordpress content outside of your blog">Display Wordpress content outside of your blog</a></li>
<li><a href="http://www.themeheven.com/2009/03/top-10-magazine-wordpress-themes-from-premiumthemes/" title="Top 10 Magazine WordPress Themes from Premiumthemes">Top 10 Magazine WordPress Themes from Premiumthemes</a></li>
<li><a href="http://www.themeheven.com/2009/04/wordpress-meta-tags-plugin/" title="WordPress Meta-Tags Plugin">WordPress Meta-Tags Plugin</a></li>
<li><a href="http://www.themeheven.com/2009/06/simple-jquery-image-slide-show-with-semi-transparent-caption/" title="Simple JQuery Image Slide Show with Semi-Transparent Caption">Simple JQuery Image Slide Show with Semi-Transparent Caption</a></li>
<li><a href="http://www.themeheven.com/2009/06/web-2-0-and-seo/" title="Web 2.0 and SEO">Web 2.0 and SEO</a></li>
<li><a href="http://www.themeheven.com/2009/03/photoshop-tutorial-sites/" title="Photoshop Tutorial Sites">Photoshop Tutorial Sites</a></li>
<li><a href="http://www.themeheven.com/2009/04/how-to-embed-google-ad-in-your-post/" title="How to: Embed Google Ad in your post">How to: Embed Google Ad in your post</a></li>
<li><a href="http://www.themeheven.com/2009/04/wordpress-tips-and-tricks/" title="Wordpress Tips and Tricks">Wordpress Tips and Tricks</a></li>
<li><a href="http://www.themeheven.com/2009/04/digital-photography-tutorial-and-tips/" title="Digital Photography Tutorial and Tips">Digital Photography Tutorial and Tips</a></li>
<li><a href="http://www.themeheven.com/2009/05/useful-wordpress-tricks-to-make-your-theme-even-better/" title="Useful Wordpress Tricks to Make Your Theme Even Better">Useful Wordpress Tricks to Make Your Theme Even Better</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.themeheven.com/2009/04/10-jquery-slider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
