<?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>Learning jQuery</title>
	<atom:link href="http://www.learningjquery.org/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.org</link>
	<description>Learning jQuery: Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Wed, 03 Mar 2010 14:12:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>10 jQuery Transition Effects: Moving Elements with Style</title>
		<link>http://www.learningjquery.org/index.php/10-jquery-transition-effects-moving-elements-with-style/</link>
		<comments>http://www.learningjquery.org/index.php/10-jquery-transition-effects-moving-elements-with-style/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 14:12:55 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Transition Effects]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=169</guid>
		<description><![CDATA[1. Fluid Navigation – How to create an informative menu-bar with jQuery &#38; CSS
Learn how to create a menu that appears like a standard menu bar in it’s default state, but which on rollover pulls down an information area that covers both the original menubar item and has an expanded section containing the text we [...]]]></description>
			<content:encoded><![CDATA[<h3>1. Fluid Navigation – How to create an informative menu-bar with jQuery &amp; CSS</h3>
<p>Learn how to create a menu that appears like a standard menu bar in it’s default state, but which on rollover pulls down an information area that covers both the original menubar item and has an expanded section containing the text we want to display.</p>
<p><a href="http://addyosmani.com/blog/fluid-navigation-how-to-create-an-informative-menu-bar-with-jquery-in-just-a-few-minutes"><img src="http://devsnippets.com/img/jquery-magic/jquery-01.jpg" alt="Fluid Navigation – How to create an informative menu-bar with jQuery &amp; CSS" /></a></p>
<h3>2. Move Elements with Style</h3>
<p>Roundabout is a jQuery plugin that converts a structure of static HTML elements into a highly customizable turntable-like interactive area. In its simplest configuration, Roundabout works with ordered- and unordered-lists, however after some quick configuration, Roundabout can work with an set of nested elements.</p>
<p><a href="http://fredhq.com/projects/roundabout/"><img src="http://devsnippets.com/img/jquery-magic/jquery-02.jpg" alt="Move Elements with Style" /></a></p>
<h3>3. Automatic Image Slider w/ CSS &amp; jQuery</h3>
<p>A simple image slider using HTML/CSS/Javascript. The html based image slider will have its benefits with SEO and will also degrade gracefully for those w/out js.</p>
<p><a href="http://www.sohtanaka.com/web-design/automatic-image-slider-w-css-jquery/"><img src="http://devsnippets.com/img/jquery-magic/jquery-03.jpg" alt="Automatic Image Slider w/ CSS &amp; jQuery" /></a></p>
<h3>4. jQuery Quicksand Plugin</h3>
<p>With Quicksand you can reorder and filter items with a nice shuffling animation. At the very basic level, Quicksand replaces one collection of items with another. All you need to do is provide those two sets of items. You can do it in a couple of ways:</p>
<ul>
<li> 1. Use plain HTML, like an unordered list.</li>
<li>2. Download data by an Ajax call</li>
<li>3. Transform HTML items by JavaScript (for example, sort them differently)</li>
</ul>
<p><a href="http://razorjack.net/quicksand/"><img src="http://devsnippets.com/img/jquery-magic/jquery-04.jpg" alt="jQuery Quicksand Plugin" /></a></p>
<h3>5. jQuery Magic Line Sliding Style Navigation</h3>
<p>The idea is to have a highlight of some kind (a background or an underline) follow you around as you mouse over the different links in the navigation. This will happen with jQuery and it’s animation abilities. As such, the “magic line” will only be appended via JavaScript. Once added to the list and styled, as you mouse over the different links, it figures out the left positioning and the width and animates to match.</p>
<p><a href="http://css-tricks.com/jquery-magicline-navigation/"><img src="http://devsnippets.com/img/jquery-magic/jquery-05.jpg" alt="jQuery Magic Line Sliding Style Navigation" /></a></p>
<h3>6. Text with Moving Backgrounds</h3>
<p>The idea is to create a container which has a moving background, but only a set of letters will be visible of the background. It will be as if there are holes in your container.</p>
<p>Normally you would create a PNG file containing anti-aliased letters and place it inside some container on top of a background. Here what you need to do is place a full image over a background, covering parts that shouldn’t be seen. Just like a mask!</p>
<p><a href="http://www.gayadesign.com/diy/text-with-moving-backgrounds-with-jquery/"><img src="http://devsnippets.com/img/jquery-magic/jquery-06.jpg" alt="Text with Moving Backgrounds" /></a></p>
<h3>7. jDiv: A jQuery navigation menu alternative</h3>
<p>A drop-down menu that displayed any content you need. Specifically a combination of images and lists, without being limited to only an unordered list. The advantages:</p>
<ul>
<li>More flexibility in design that your usual UL style;</li>
<li>The use of the H4 tag <em>and</em> a UL for the hidden content adds some potential SEO but be sure that your header tag choice is in keeping with your copy’s layout;</li>
<li>As long as your first-level nav item is linked to a page, you still retain accessibility with JS disabled.</li>
</ul>
<p><a href="http://www.skyrocketlabs.com/articles/jdiv-a-jquery-navigation-menu-alternative.php"><img src="http://devsnippets.com/img/jquery-magic/jquery-07.jpg" alt="jDiv: A jQuery navigation menu alternative" /></a></p>
<h3>8. Halftone Navigation Menu With jQuery &amp; CSS3</h3>
<p>A CSS3 &amp; jQuery halftone-style navigation menu, which will allow you to display animated halftone-style shapes in accordance with the navigation links, and will provide a simple editor for creating additional shapes as well.</p>
<p><a href="http://tutorialzine.com/2010/01/halftone-navigation-menu-jquery-css/"><img src="http://devsnippets.com/img/jquery-magic/jquery-08.jpg" alt="Halftone Navigation Menu With jQuery &amp; CSS3" /></a></p>
<h3>9. Animate Panning Slideshow with jQuery</h3>
<p>Highly visual websites rely on the ability to showcase imagery automatically. Whether it be a professional photographer or zoo, slideshows pop up so frequently because they work well. In this tutorial we’ll have a slideshow that transitions by changing the visible window.</p>
<p><a href="http://buildinternet.com/2010/02/animate-panning-slideshow-with-jquery/"><img src="http://devsnippets.com/img/jquery-magic/jquery-09.jpg" alt="Animate Panning Slideshow with jQuery" /></a></p>
<h3>10. SlideDeck</h3>
<p>SlideDeck is a new way to display content on websites, mobile phones and kiosks. It delivers a better user experience by removing the information overload and providing a fun, quick and beautiful way to interact with digital devices.</p>
<p><a href="http://www.slidedeck.com/"><img src="http://devsnippets.com/img/jquery-magic/jquery-10.jpg" alt="SlideDeck" /></a></p>
<h4><strong><br />
</strong><a href="http://devsnippets.com/"><strong></strong></a></h4>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/10-jquery-transition-effects-moving-elements-with-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery1.4发布</title>
		<link>http://www.learningjquery.org/index.php/jquery1-4-release/</link>
		<comments>http://www.learningjquery.org/index.php/jquery1-4-release/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:45:36 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery1.4]]></category>
		<category><![CDATA[下载]]></category>
		<category><![CDATA[特性]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=146</guid>
		<description><![CDATA[在庆祝jQuery4周岁生日之际，jQuery开发团队隆重推出其最新版的JavaScript框架jQuery1.4。
下载链接
* jQuery Minified (23kb Gzipped)
* jQuery Regular (154kb)
当然，我们也可以直接使用来自Google服务器上托管的版本：http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js ，这使得您可以快速的加载jQuery文件。
关于此次版本更新的详细信息可参见jQuery官方文档。
]]></description>
			<content:encoded><![CDATA[<p>在庆祝jQuery4周岁生日之际，jQuery开发团队隆重推出其最新版的JavaScript框架jQuery1.4。</p>
<p><strong>下载链接</strong></p>
<p>* <a title="jQuery Minified" href="http://code.jquery.com/jquery-1.4.min.js">jQuery Minified (23kb Gzipped)</a></p>
<p>* <a title="jQuery Regular" href="http://code.jquery.com/jquery-1.4.js">jQuery Regular (154kb)</a></p>
<p>当然，我们也可以直接使用来自Google服务器上托管的版本：http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js ，这使得您可以快速的加载jQuery文件。</p>
<p>关于此次版本更新的详细信息可参见<a title="jQuery官方文档" href="http://api.jquery.com/category/version/1.4/">jQuery官方文档</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/jquery1-4-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009年度最佳CSS设计</title>
		<link>http://www.learningjquery.org/index.php/2009-best-css-design-of/</link>
		<comments>http://www.learningjquery.org/index.php/2009-best-css-design-of/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 23:07:26 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[CSS设计]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=144</guid>
		<description><![CDATA[Sushi and Robots

Bobulate

A Way Back

LegiStyles

For a Beautiful Web

Black Estate

Cynosura

Mark Dearman

iA

Trent Walton

Area 17

Nosotros

Atebits

Square Space

Gap Medics

Fringe

Typographica

Book Cover Archive

Search Inside Video

Red Nose Day

Carsonified

Fajne Chlopaki

Devia

Mail Chimp

Miro

Squared Eye

Clear Left

White House

45 Royale

Work at Play

Wonderbra

Legwork studio

Surly

Project 365

72 Ave

Maxvoltar

We Heart

Jeff Finley

Elliot Jay Stocks

SimpleBits

Corking Design

Adii

Burciaga

Paravel

Jeremy Charles

Brite Revolution

Go Media

31 Three

AN idea

Mission Bicycle

]]></description>
			<content:encoded><![CDATA[<h3>Sushi and Robots</h3>
<p><a href="http://sushiandrobots.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/sushiandrobots-lg.jpg" alt="screenshot" /></a></p>
<h3>Bobulate</h3>
<p><a href="http://bobulate.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/bobulate-lg.jpg" alt="screenshot" /></a></p>
<h3>A Way Back</h3>
<p><a href="http://www.awayback.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/awayback-lg.jpg" alt="screenshot" /></a></p>
<h3>LegiStyles</h3>
<p><a href="http://legistyles.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/legistyles-lg.jpg" alt="screenshot" /></a></p>
<h3>For a Beautiful Web</h3>
<p><a href="http://forabeautifulweb.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/forabeautifulweb-lg.jpg" alt="screenshot" /></a></p>
<h3>Black Estate</h3>
<p><a href="http://www.blackestate.co.nz/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/blackestate-lg.jpg" alt="screenshot" /></a></p>
<h3>Cynosura</h3>
<p><a href="http://weblog.cynosura.eu/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/cynosura-lg.jpg" alt="screenshot" /></a></p>
<h3>Mark Dearman</h3>
<p><a href="http://www.markdearman.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/markdearman-lg.jpg" alt="screenshot" /></a></p>
<h3>iA</h3>
<p><a href="http://informationarchitects.jp/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/informationarchitects-lg.jpg" alt="screenshot" /></a></p>
<h3>Trent Walton</h3>
<p><a href="http://trentwalton.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/trentwalton-lg.jpg" alt="screenshot" /></a></p>
<h3>Area 17</h3>
<p><a href="http://www.area17.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/area17-lg.jpg" alt="screenshot" /></a></p>
<h3>Nosotros</h3>
<p><a href="http://www.nosotroshq.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/nosotroshq-lg.jpg" alt="screenshot" /></a></p>
<h3>Atebits</h3>
<p><a href="http://www.atebits.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/atebits-lg.jpg" alt="screenshot" /></a></p>
<h3>Square Space</h3>
<p><a href="http://blog.squarespace.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/squarespace-lg.jpg" alt="screenshot" /></a></p>
<h3>Gap Medics</h3>
<p><a href="http://www.gapmedics.co.uk/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/gapmedics-lg.jpg" alt="screenshot" /></a></p>
<h3>Fringe</h3>
<p><a href="http://www.fox.com/fringe"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/fringe-lg.jpg" alt="screenshot" /></a></p>
<h3>Typographica</h3>
<p><a href="http://new.typographica.org/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/typographica-lg.jpg" alt="screenshot" /></a></p>
<h3>Book Cover Archive</h3>
<p><a href="http://www.bookcoverarchive.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/bookcoverarchive-lg.jpg" alt="screenshot" /></a></p>
<h3>Search Inside Video</h3>
<p><a href="http://searchinsidevideo.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/searchinsidevideo-lg.jpg" alt="screenshot" /></a></p>
<h3>Red Nose Day</h3>
<p><a href="http://www.rednoseday.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/rednoseday-lg.jpg" alt="screenshot" /></a></p>
<h3>Carsonified</h3>
<p><a href="http://carsonified.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/carsonified-lg.jpg" alt="screenshot" /></a></p>
<h3>Fajne Chlopaki</h3>
<p><a href="http://www.fajnechlopaki.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/fajnechlopaki-lg.jpg" alt="screenshot" /></a></p>
<h3>Devia</h3>
<p><a href="http://www.devia.be/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/devia-lg.jpg" alt="screenshot" /></a></p>
<h3>Mail Chimp</h3>
<p><a href="http://www.mailchimp.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/mailchimp-lg.jpg" alt="screenshot" /></a></p>
<h3>Miro</h3>
<p><a href="http://www.getmiro.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/getmiro-lg.jpg" alt="screenshot" /></a></p>
<h3>Squared Eye</h3>
<p><a href="http://squaredeye.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/squaredeye-lg.jpg" alt="screenshot" /></a></p>
<h3>Clear Left</h3>
<p><a href="http://clearleft.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/clearleft-lg.jpg" alt="screenshot" /></a></p>
<h3>White House</h3>
<p><a href="http://www.whitehouse.gov/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/whitehouse-lg.jpg" alt="screenshot" /></a></p>
<h3>45 Royale</h3>
<p><a href="http://www.45royale.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/45royale-lg.jpg" alt="screenshot" /></a></p>
<h3>Work at Play</h3>
<p><a href="http://www.workatplay.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/workatplay-lg.jpg" alt="screenshot" /></a></p>
<h3>Wonderbra</h3>
<p><a href="http://www.ultimatestrapless.co.uk/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/ultimatestrapless-lg.jpg" alt="screenshot" /></a></p>
<h3>Legwork studio</h3>
<p><a href="http://www.legworkstudio.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/legworkstudio-lg.jpg" alt="screenshot" /></a></p>
<h3>Surly</h3>
<p><a href="http://www.sursly.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/sursly-lg.jpg" alt="screenshot" /></a></p>
<h3>Project 365</h3>
<p><a href="http://www.project365.co.uk/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/project365-lg.jpg" alt="screenshot" /></a></p>
<h3>72 Ave</h3>
<p><a href="http://72ave.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/72ave-lg.jpg" alt="screenshot" /></a></p>
<h3>Maxvoltar</h3>
<p><a href="http://maxvoltar.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/maxvoltar-lg.jpg" alt="screenshot" /></a></p>
<h3>We Heart</h3>
<p><a href="http://www.weheart.co.uk/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/weheart-lg.jpg" alt="screenshot" /></a></p>
<h3>Jeff Finley</h3>
<p><a href="http://www.jefffinley.org/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/jefffinley-lg.jpg" alt="screenshot" /></a></p>
<h3>Elliot Jay Stocks</h3>
<p><a href="http://elliotjaystocks.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/elliotjaystocks-lg.jpg" alt="screenshot" /></a></p>
<h3>SimpleBits</h3>
<p><a href="http://simplebits.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/simplebits-lg.jpg" alt="screenshot" /></a></p>
<h3>Corking Design</h3>
<p><a href="http://corkingdesign.co.uk/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/corkingdesign-lg.jpg" alt="screenshot" /></a></p>
<h3>Adii</h3>
<p><a href="http://adiirockstar.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/adiirockstar-lg.jpg" alt="screenshot" /></a></p>
<h3>Burciaga</h3>
<p><a href="http://ismaelburciaga.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/ismaelburciaga-lg.jpg" alt="screenshot" /></a></p>
<h3>Paravel</h3>
<p><a href="http://www.paravelinc.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/paravelinc-lg.jpg" alt="screenshot" /></a></p>
<h3>Jeremy Charles</h3>
<p><a href="http://www.jeremycharles.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/jeremycharles-lg.jpg" alt="screenshot" /></a></p>
<h3>Brite Revolution</h3>
<p><a href="http://www.briterevolution.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/briterevolution-lg.jpg" alt="screenshot" /></a></p>
<h3>Go Media</h3>
<p><a href="http://www.gomedia.us/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/gomedia-lg.jpg" alt="screenshot" /></a></p>
<h3>31 Three</h3>
<p><a href="http://www.31three.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/31three-lg.jpg" alt="screenshot" /></a></p>
<h3>AN idea</h3>
<p><a href="http://anidea.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/anidea-lg.jpg" alt="screenshot" /></a></p>
<h3>Mission Bicycle</h3>
<p><a href="http://www.missionbicycle.com/"><img src="http://www.webdesignerwall.com/wp-content/uploads/2009/12/missionbicycle-lg.jpg" alt="screenshot" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/2009-best-css-design-of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009年度最佳WordPress主题</title>
		<link>http://www.learningjquery.org/index.php/2009-best-wordpress-template/</link>
		<comments>http://www.learningjquery.org/index.php/2009-best-wordpress-template/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 16:19:08 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Themes]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress，免费主题]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=140</guid>
		<description><![CDATA[Magazeen

Bueno

Gallery

Manifest

deStyle

Imprezz

Folio Elements

Compositio

Selecta

Irresistible

Glassical

Mainstream

FREEmium

Black Power

Vintage

]]></description>
			<content:encoded><![CDATA[<h3><a href="http://www.smashingmagazine.com/2009/02/23/magazeen-free-magazine-look-wordpress-theme/" target="_blank">Magazeen</a></h3>
<p><a href="http://www.smashingmagazine.com/2009/02/23/magazeen-free-magazine-look-wordpress-theme/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_1.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.woothemes.com/2009/11/bueno/" target="_blank">Bueno</a></h3>
<p><a href="http://www.woothemes.com/2009/11/bueno/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_2.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.smashingmagazine.com/2009/05/04/download-gallery-a-free-wordpress-theme/" target="_blank">Gallery</a></h3>
<p><a href="http://www.smashingmagazine.com/2009/05/04/download-gallery-a-free-wordpress-theme/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_3.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://jimbarraud.com/2009/03/19/manifest/" target="_blank">Manifest</a></h3>
<p><a href="http://jimbarraud.com/2009/03/19/manifest/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_14.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://themeshift.com/destyle/" target="_blank">deStyle</a></h3>
<p><a href="http://themeshift.com/destyle/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_7.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.smashingmagazine.com/2009/03/10/download-imprezz-a-free-wordpress-theme/" target="_blank">Imprezz</a></h3>
<p><a href="http://www.smashingmagazine.com/2009/03/10/download-imprezz-a-free-wordpress-theme/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_4.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.press75.com/the-folio-elements-wordpress-theme/" target="_blank">Folio Elements</a></h3>
<p><a href="http://www.press75.com/the-folio-elements-wordpress-theme/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_13.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.smashingmagazine.com/2009/02/18/compositio-clean-beautiful-and-free-wordpress-theme/" target="_blank">Compositio</a></h3>
<p><a href="http://www.smashingmagazine.com/2009/02/18/compositio-clean-beautiful-and-free-wordpress-theme/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_5.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.obox-design.com/themes_page.cfm/theme/selecta" target="_blank">Selecta</a></h3>
<p><a href="http://www.obox-design.com/themes_page.cfm/theme/selecta" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_6.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.woothemes.com/2009/02/irresistible/" target="_blank">Irresistible</a></h3>
<p><a href="http://www.woothemes.com/2009/02/irresistible/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_8.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.smashingmagazine.com/2009/11/07/glassical-a-free-wordpress-theme/" target="_blank">Glassical</a></h3>
<p><a href="http://www.smashingmagazine.com/2009/11/07/glassical-a-free-wordpress-theme/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_9.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.woothemes.com/2009/07/mainstream/" target="_blank">Mainstream</a></h3>
<p><a href="http://www.woothemes.com/2009/07/mainstream/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_10.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://freebiesdock.com/freemium-wordpress-theme/" target="_blank">FREEmium</a></h3>
<p><a href="http://freebiesdock.com/freemium-wordpress-theme/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_11.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.skinpress.com/blackpower-theme/" target="_blank">Black Power</a></h3>
<p><a href="http://www.skinpress.com/blackpower-theme/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_12.jpg" alt="wordpress theme" /></a></p>
<h3><a href="http://www.smashingmagazine.com/2009/01/28/vintage-and-blues-wordpress-themes/" target="_blank">Vintage</a></h3>
<p><a href="http://www.smashingmagazine.com/2009/01/28/vintage-and-blues-wordpress-themes/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_15.jpg" alt="wordpress theme" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/2009-best-wordpress-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009 年度最佳 jQuery 插件</title>
		<link>http://www.learningjquery.org/index.php/2009-best-jquery-plug-in/</link>
		<comments>http://www.learningjquery.org/index.php/2009-best-jquery-plug-in/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 15:53:44 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[jQuery 插件]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=137</guid>
		<description><![CDATA[jQuery 是个宝库，而 jQuery 的插件体系是个取之不竭的宝库，众多开发者在 jQuery 框架下，设计了数不清的插件，jQuery  的特长是网页效果，因此，它的插件库也多与 UI 有关。本文是 webdesignledger.com 网站推选的2009年度最佳 jQuery 插件。]]></description>
			<content:encoded><![CDATA[<p>jQuery 是个宝库，而 jQuery 的插件体系是个取之不竭的宝库，众多开发者在 jQuery 框架下，设计了数不清的插件，jQuery  的特长是网页效果，因此，它的插件库也多与 UI 有关。本文是 <a href="http://www.webdesignledger.com/">webdesignledger.com</a> 网站推选的2009年度最佳 jQuery 插件。</p>
<h3>拉洋片</h3>
<p>在一个固定区域，循环显示几段内容，这种方式很像旧时的拉洋片，2009年，这种 Web 效果大行其道，jQuery 有大量与此有关的插件，以下插件无疑是最佳的。</p>
<h3><a href="http://css-tricks.com/anythingslider-jquery-plugin/" target="_blank">AnythingSlider</a></h3>
<p><a href="http://css-tricks.com/anythingslider-jquery-plugin/" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_1.jpg" alt="jquery plugins" /></a></p>
<p>由 CSS-Tricks 的 Chris Coyier 设计，功能齐全，应用十分广泛。</p>
<h3><a href="http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider" target="_blank">Easy Slider</a></h3>
<p><a href="http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_3.jpg" alt="jquery plugins" /></a></p>
<p>这个 Content Slider 插件既包含传统“前后”导航模式，又包含页码式导航。</p>
<h3><a href="http://www.ndoherty.biz/tag/coda-slider/" target="_blank">Coda-Slider 2.0</a></h3>
<p><a href="http://www.ndoherty.biz/tag/coda-slider/" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_7.jpg" alt="jquery plugins" /></a></p>
<p>Coda-Slider 2.0 是对 Panic Coda 网站上对应效果的模仿。</p>
<h3>图片库</h3>
<p>那些需要借助 Flash 实现滑动与渐入渐出效果图片库的日子已经去过，借助 jQuery，这种效果已经可以在本地实现，以下是本年度备受欢迎的几个 jQuery 图片库插件。</p>
<h3><a href="http://devkick.com/lab/galleria/" target="_blank">Galleria</a></h3>
<p><a href="http://devkick.com/lab/galleria/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_4.jpg" alt="jquery plugins" /></a></p>
<p>这是一个基于 jQuery 的图片库，可以逐个加载图片并显示缩略图。</p>
<h3><a href="http://www.catchmyfame.com/2009/08/13/jquery-panel-gallery-1-1-plugin-released/" target="_blank">jQuery Panel Gallery</a></h3>
<p><a href="http://www.catchmyfame.com/2009/08/13/jquery-panel-gallery-1-1-plugin-released/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_5.jpg" alt="jquery plugins" /></a></p>
<p>一个可以高度定义的图片库插件，无需对单个图片进行任何处理，这个插件会帮你完成一切。</p>
<h3><a href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html" target="_blank">slideViewer</a></h3>
<p><a href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_10.jpg" alt="jquery plugins" /></a></p>
<p>slideViewer 会检查你的图片列表中的编号，动态创建各个图片的页码浏览导航。</p>
<h3><a href="http://www.buildinternet.com/project/supersized/" target="_blank">Supersized</a></h3>
<p><a href="http://www.buildinternet.com/project/supersized/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_6.jpg" alt="jquery plugins" /></a></p>
<p>一个令人惊讶的图片循环展示插件，包含各种变换效果和预加载选项，会对图片自动改变尺寸以适应浏览器窗口。</p>
<h3>导航</h3>
<p>我们相信，作为网站的导航系统，应该越简单，越易用越好，然而，假如你确实希望实现一些更炫的效果，jQuery 就是最好的选项，以下插件是09年最好的 jQuery  导航插件。</p>
<h3><a href="http://pupunzi.open-lab.com/mb-jquery-components/mb-_menu/" target="_blank">jquery mb.menu</a></h3>
<p><a href="http://pupunzi.open-lab.com/mb-jquery-components/mb-_menu/" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_8.jpg" alt="jquery plugins" /></a></p>
<h3><a href="http://www.queness.com/post/256/horizontal-scroll-menu-with-jquery-tutorial" target="_blank">Horizontal Scroll Menu with jQuery </a></h3>
<p><a href="http://www.queness.com/post/256/horizontal-scroll-menu-with-jquery-tutorial" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_16.jpg" alt="jquery plugins" /></a></p>
<h3><a href="http://www.newmediacampaigns.com/page/autosprites-jquery-menu-plugin" target="_blank">AutoSprites</a></h3>
<p><a href="http://www.newmediacampaigns.com/page/autosprites-jquery-menu-plugin" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_9.jpg" alt="jquery plugins" /></a></p>
<h3>表单和表格</h3>
<p>在 Web 设计中，表单和表格都是不是很讨人喜欢的东西，但你不得不面对，本年度出现几个不错的 jQuery  插件帮你完成这些任务。</p>
<h3><a href="http://www.unwrongest.com/projects/password-strength/" target="_blank">Password Strength</a></h3>
<p><a href="http://www.unwrongest.com/projects/password-strength/" target="_blank"><img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_12.jpg" alt="jquery plugins" /></a></p>
<p>这个插件帮你评估用户输入的密码是否足够强壮。</p>
<h3><a href="http://www.webdesignbeach.com/beachbar/ajax-fancy-captcha-jquery-plugin" target="_blank">Ajax Fancy Capcha</a></h3>
<p><a href="http://www.webdesignbeach.com/beachbar/ajax-fancy-captcha-jquery-plugin" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_13.jpg" alt="jquery plugins" /></a></p>
<p>顾名思义，一个支持 Ajax 又很炫的 jQuery Captcha 插件，它使用了很人性化的验证机制。</p>
<h3><a href="http://www.chromaloop.com/posts/chromatable-jquery-plugin" target="_blank">Chromatable</a></h3>
<p><a href="http://www.chromaloop.com/posts/chromatable-jquery-plugin" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/11/jquery_tables_10.jpg" alt="jquery tables" /></a></p>
<p>这个插件可以帮助你在表格上实现滚动条。</p>
<h3><a href="http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/" target="_blank">jqTransform</a></h3>
<p><a href="http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_14.jpg" alt="jquery plugins" /></a></p>
<p>一个式样插件，帮助你对表单中的控件进行式样控制。</p>
<h3><a href="http://www.uploadify.com/" target="_blank">Uploadify</a></h3>
<p><a href="http://www.uploadify.com/" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_15.jpg" alt="jquery plugins" /></a></p>
<p>实现多个文件同时上传。</p>
<h3><a href="http://www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-with-jQuery-jExpand-plugin.aspx" target="_blank">jExpand </a></h3>
<p><a href="http://www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-with-jQuery-jExpand-plugin.aspx" target="_blank"><img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/11/jquery_tables_1.jpg" alt="jquery tables" /></a></p>
<p>一个很轻量的 jQuery 插件，使你的表格可以扩展，在一些商业应用中，可以让表格更容易组织其中的内容。</p>
<p>本文来源：<a href="http://webdesignledger.com/resources/the-best-jquery-plugins-of-2009">http://webdesignledger.com/resources/the-best-jquery-plugins-of-2009</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/2009-best-jquery-plug-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>香山红叶节</title>
		<link>http://www.learningjquery.org/index.php/xiangshan-red-leaf-festival/</link>
		<comments>http://www.learningjquery.org/index.php/xiangshan-red-leaf-festival/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 08:47:59 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[生活]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=128</guid>
		<description><![CDATA[周日，在MM的强烈忽悠下去了香山，虽说没看到传说中的满山红叶，却也玩得很尽兴。MM买了一打十二生宵的枫叶标本，有需要的同学可以留言。

红叶、远山

琉璃塔

静宜园记

红叶近景
]]></description>
			<content:encoded><![CDATA[<p>周日，在MM的强烈忽悠下去了香山，虽说没看到传说中的满山红叶，却也玩得很尽兴。MM买了一打十二生宵的枫叶标本，有需要的同学可以留言。</p>
<p><img class="aligncenter size-full wp-image-129" title="红叶" src="http://www.learningjquery.cn/wp-content/2009/10/1.png" alt="红叶" width="600" height="450" /></p>
<p style="text-align: center;">红叶、远山</p>
<p><img class="aligncenter size-full wp-image-131" title="琉璃塔" src="http://www.learningjquery.cn/wp-content/2009/10/2.png" alt="琉璃塔" width="600" height="450" /></p>
<p style="text-align: center;">琉璃塔</p>
<p><img class="aligncenter size-full wp-image-132" title="静宜园记" src="http://www.learningjquery.cn/wp-content/2009/10/3.png" alt="静宜园记" width="600" height="450" /></p>
<p style="text-align: center;">静宜园记</p>
<p><img class="aligncenter size-full wp-image-130" title="红叶近景" src="http://www.learningjquery.cn/wp-content/2009/10/4.png" alt="红叶近景" width="600" height="450" /></p>
<p style="text-align: center;">红叶近景</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/xiangshan-red-leaf-festival/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making A Cool Login System With PHP, MySQL &amp; jQuery</title>
		<link>http://www.learningjquery.org/index.php/making-a-cool-login-system-with-php-mysql-u0026amp-jquery/</link>
		<comments>http://www.learningjquery.org/index.php/making-a-cool-login-system-with-php-mysql-u0026amp-jquery/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 01:01:16 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[demo]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=125</guid>
		<description><![CDATA[Introduction
Today we are making a cool &#38; simple login / registration system. It will give you the ability to easily create a member-only area on your site and provide an easy registration process.
It is going to be PHP driven and store all the registrations into a MySQL database.
To add the needed flair, we are using [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>Today we are making a cool &amp; simple login / registration system. It will give you the ability to easily create a member-only area on your site and provide an easy registration process.</p>
<p>It is going to be PHP driven and store all the registrations into a MySQL database.</p>
<p>To add the needed flair, we are using the amazing <a href="http://web-kreation.com/index.php/tutorials/nice-clean-sliding-login-panel-built-with-jquery/" target="_blank">sliding jQuery panel</a>, developed by <a href="http://web-kreation.com/" target="_blank">Web-kreation</a>.</p>
<h3>Step 1 – MySQL</h3>
<p>First we have to create the table that will hold all the registrations. This code is available in <strong>table.sql</strong>.</p>
<h4>table.sql</h4>
<div id="highlighter_901965">
<div>
<div><a style="width: 16px; height: 16px;" title="view source" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#viewSource">view source</a><a style="width: 16px; height: 16px;" title="print" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#printSource">print</a><a style="width: 16px; height: 16px;" title="?" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#about">?</a></div>
</div>
<div>
<div><code>01.</code><span><span style="margin-left: 0px ! important;"><code>--</code></span></span></div>
<div><code>02.</code><span><span style="margin-left: 0px ! important;"><code>-- Table structure for table `tz_members`</code></span></span></div>
<div><code>03.</code><span><span style="margin-left: 0px ! important;"><code>--</code></span></span></div>
<div><code>04.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>05.</code><span><span style="margin-left: 0px ! important;"><code>CREATE</code> <code>TABLE</code> <code>`tz_members` (</code></span></span></div>
<div><code>06.</code><span><code> </code><span style="margin-left: 14px ! important;"><code>`id` </code><code>int</code><code>(11) </code><code>NOT</code> <code>NULL</code> <code>auto_increment,</code></span></span></div>
<div><code>07.</code><span><code> </code><span style="margin-left: 14px ! important;"><code>`usr` </code><code>varchar</code><code>(32) </code><code>collate</code> <code>utf8_unicode_ci </code><code>NOT</code> <code>NULL</code> <code>default</code> <code>''</code><code>,</code></span></span></div>
<div><code>08.</code><span><code> </code><span style="margin-left: 14px ! important;"><code>`pass` </code><code>varchar</code><code>(32) </code><code>collate</code> <code>utf8_unicode_ci </code><code>NOT</code> <code>NULL</code> <code>default</code> <code>''</code><code>,</code></span></span></div>
<div><code>09.</code><span><code> </code><span style="margin-left: 14px ! important;"><code>`email` </code><code>varchar</code><code>(255) </code><code>collate</code> <code>utf8_unicode_ci </code><code>NOT</code> <code>NULL</code> <code>default</code> <code>''</code><code>,</code></span></span></div>
<div><code>10.</code><span><code> </code><span style="margin-left: 14px ! important;"><code>`regIP` </code><code>varchar</code><code>(15) </code><code>collate</code> <code>utf8_unicode_ci </code><code>NOT</code> <code>NULL</code> <code>default</code> <code>''</code><code>,</code></span></span></div>
<div><code>11.</code><span><code> </code><span style="margin-left: 14px ! important;"><code>`dt` datetime </code><code>NOT</code> <code>NULL</code> <code>default</code> <code>'0000-00-00 00:00:00'</code><code>,</code></span></span></div>
<div><code>12.</code><span><code> </code><span style="margin-left: 14px ! important;"><code>PRIMARY</code> <code>KEY</code> <code>(`id`),</code></span></span></div>
<div><code>13.</code><span><code> </code><span style="margin-left: 14px ! important;"><code>UNIQUE</code> <code>KEY</code> <code>`usr` (`usr`)</code></span></span></div>
<div><code>14.</code><span><span style="margin-left: 0px ! important;"><code>) ENGINE=MyISAM </code><code>DEFAULT</code> <code>CHARSET=utf8 </code><code>COLLATE</code><code>=utf8_unicode_ci;</code></span></span></div>
</div>
</div>
<p>Notice that we’ve defined the id as an integer with <strong>auto_increment</strong> – it is automatically assigned to every site member. Also, we’ve defined <strong>usr</strong> as an <strong>unique key</strong> – no two users with the same usernames are allowed.</p>
<p>We later use this in the registration to determine whether the username has been taken.</p>
<p>After you create the table, do not forget to fill in your database credentials in <strong>connect.php</strong> so you can run the demo on your own server.</p>
<h3>Step 2 – XHTML</h3>
<p>First, we have to incorporate Web-kreation’s form into our page.</p>
<h4>demo.php</h4>
<div id="highlighter_799221">
<div>
<div><a style="width: 16px; height: 16px;" title="view source" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#viewSource">view source</a><a style="width: 16px; height: 16px;" title="print" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#printSource">print</a><a style="width: 16px; height: 16px;" title="?" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#about">?</a></div>
</div>
<div>
<div><code>001.</code><span><span style="margin-left: 0px ! important;"><code>&lt;!-- Panel --&gt;</code></span></span></div>
<div><code>002.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>id</code><code>=</code><code>"toppanel"</code><code>&gt;</code></span></span></div>
<div><code>003.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>004.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>id</code><code>=</code><code>"panel"</code><code>&gt;</code></span></span></div>
<div><code>005.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"content clearfix"</code><code>&gt;</code></span></span></div>
<div><code>006.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"left"</code><code>&gt;</code></span></span></div>
<div><code>007.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>h1</code><code>&gt;The Sliding jQuery Panel&lt;/</code><code>h1</code><code>&gt;</code></span></span></div>
<div><code>008.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>h2</code><code>&gt;A register/login solution&lt;/</code><code>h2</code><code>&gt;</code></span></span></div>
<div><code>009.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>p</code> <code>class</code><code>=</code><code>"grey"</code><code>&gt;You are free to use this login and registration system in you sites!&lt;/</code><code>p</code><code>&gt;</code></span></span></div>
<div><code>010.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>h2</code><code>&gt;A Big Thanks&lt;/</code><code>h2</code><code>&gt;</code></span></span></div>
<div><code>011.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>p</code> <code>class</code><code>=</code><code>"grey"</code><code>&gt;This tutorial was built on top of &lt;</code><code>a</code> <code>href</code><code>=</code><code>"<a href="http://web-kreation.com/index.php/tutorials/nice-clean-sliding-login-panel-built-with-jquery">http://web-kreation.com/index.php/tutorials/nice-clean-sliding-login-panel-built-with-jquery</a>"</code> <code>title</code><code>=</code><code>"Go to site"</code><code>&gt;Web-Kreation&lt;/</code><code>a</code><code>&gt;'s amazing sliding panel.&lt;/</code><code>p</code><code>&gt;</code></span></span></div>
<div><code>012.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>013.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>014.</code><span><span style="margin-left: 0px ! important;"><code>&lt;?</code><code>php</code></span></span></div>
<div><code>015.</code><span><span style="margin-left: 0px ! important;"><code>if(!$_SESSION['id']):</code></span></span></div>
<div><code>016.</code><span><span style="margin-left: 0px ! important;"><code>// If you are not logged in</code></span></span></div>
<div><code>017.</code><span><span style="margin-left: 0px ! important;"><code>?&gt;</code></span></span></div>
<div><code>018.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>019.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"left"</code><code>&gt;</code></span></span></div>
<div><code>020.</code><span><span style="margin-left: 0px ! important;"><code>&lt;!-- Login Form --&gt;</code></span></span></div>
<div><code>021.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>form</code> <code>class</code><code>=</code><code>"clearfix"</code> <code>action</code><code>=</code><code>""</code> <code>method</code><code>=</code><code>"post"</code><code>&gt;</code></span></span></div>
<div><code>022.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>h1</code><code>&gt;Member Login&lt;/</code><code>h1</code><code>&gt;</code></span></span></div>
<div><code>023.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>024.</code><span><span style="margin-left: 0px ! important;"><code>&lt;?</code><code>php</code></span></span></div>
<div><code>025.</code><span><span style="margin-left: 0px ! important;"><code>if($_SESSION['msg']['login-err'])</code></span></span></div>
<div><code>026.</code><span><span style="margin-left: 0px ! important;"><code>{</code></span></span></div>
<div><code>027.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>echo '&lt;div </code><code>class</code><code>=</code><code>"err"</code><code>&gt;'.$_SESSION['msg']['login-err'].'&lt;/</code><code>div</code><code>&gt;';</code></span></span></div>
<div><code>028.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>unset($_SESSION['msg']['login-err']);</code></span></span></div>
<div><code>029.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// This will output login errors, if any</code></span></span></div>
<div><code>030.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>031.</code><span><span style="margin-left: 0px ! important;"><code>?&gt;</code></span></span></div>
<div><code>032.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>033.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>label</code> <code>class</code><code>=</code><code>"grey"</code> <code>for</code><code>=</code><code>"username"</code><code>&gt;Username:&lt;/</code><code>label</code><code>&gt;</code></span></span></div>
<div><code>034.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>input</code> <code>class</code><code>=</code><code>"field"</code> <code>type</code><code>=</code><code>"text"</code> <code>name</code><code>=</code><code>"username"</code> <code>id</code><code>=</code><code>"username"</code> <code>value</code><code>=</code><code>""</code> <code>size</code><code>=</code><code>"23"</code> <code>/&gt;</code></span></span></div>
<div><code>035.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>label</code> <code>class</code><code>=</code><code>"grey"</code> <code>for</code><code>=</code><code>"password"</code><code>&gt;Password:&lt;/</code><code>label</code><code>&gt;</code></span></span></div>
<div><code>036.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>input</code> <code>class</code><code>=</code><code>"field"</code> <code>type</code><code>=</code><code>"password"</code> <code>name</code><code>=</code><code>"password"</code> <code>id</code><code>=</code><code>"password"</code> <code>size</code><code>=</code><code>"23"</code> <code>/&gt;</code></span></span></div>
<div><code>037.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>label</code><code>&gt;&lt;</code><code>input</code> <code>name</code><code>=</code><code>"rememberMe"</code> <code>id</code><code>=</code><code>"rememberMe"</code> <code>type</code><code>=</code><code>"checkbox"</code> <code>checked</code><code>=</code><code>"checked"</code> <code>value</code><code>=</code><code>"1"</code> <code>/&gt; &amp;nbsp;Remember me&lt;/</code><code>label</code><code>&gt;</code></span></span></div>
<div><code>038.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"clear"</code><code>&gt;&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>039.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>input</code> <code>type</code><code>=</code><code>"submit"</code> <code>name</code><code>=</code><code>"submit"</code> <code>value</code><code>=</code><code>"Login"</code> <code>class</code><code>=</code><code>"bt_login"</code> <code>/&gt;</code></span></span></div>
<div><code>040.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>form</code><code>&gt;</code></span></span></div>
<div><code>041.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>042.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>043.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>044.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"left right"</code><code>&gt;</code></span></span></div>
<div><code>045.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>046.</code><span><span style="margin-left: 0px ! important;"><code>&lt;!-- Register Form --&gt;</code></span></span></div>
<div><code>047.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>048.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>form</code> <code>action</code><code>=</code><code>""</code> <code>method</code><code>=</code><code>"post"</code><code>&gt;</code></span></span></div>
<div><code>049.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>h1</code><code>&gt;Not a member yet? Sign Up!&lt;/</code><code>h1</code><code>&gt;</code></span></span></div>
<div><code>050.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>051.</code><span><span style="margin-left: 0px ! important;"><code>&lt;?</code><code>php</code></span></span></div>
<div><code>052.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>053.</code><span><span style="margin-left: 0px ! important;"><code>if($_SESSION['msg']['reg-err'])</code></span></span></div>
<div><code>054.</code><span><span style="margin-left: 0px ! important;"><code>{</code></span></span></div>
<div><code>055.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>echo '&lt;div </code><code>class</code><code>=</code><code>"err"</code><code>&gt;'.$_SESSION['msg']['reg-err'].'&lt;/</code><code>div</code><code>&gt;';</code></span></span></div>
<div><code>056.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>unset($_SESSION['msg']['reg-err']);</code></span></span></div>
<div><code>057.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// This will output the registration errors, if any</code></span></span></div>
<div><code>058.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>059.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>060.</code><span><span style="margin-left: 0px ! important;"><code>if($_SESSION['msg']['reg-success'])</code></span></span></div>
<div><code>061.</code><span><span style="margin-left: 0px ! important;"><code>{</code></span></span></div>
<div><code>062.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>echo '&lt;</code><code>div</code> <code>class</code><code>=</code><code>"success"</code><code>&gt;'.$_SESSION['msg']['reg-success'].'&lt;/</code><code>div</code><code>&gt;';</code></span></span></div>
<div><code>063.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>unset($_SESSION['msg']['reg-success']);</code></span></span></div>
<div><code>064.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// This will output the registration success message</code></span></span></div>
<div><code>065.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>066.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>067.</code><span><span style="margin-left: 0px ! important;"><code>?&gt;</code></span></span></div>
<div><code>068.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>069.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>label</code> <code>class</code><code>=</code><code>"grey"</code> <code>for</code><code>=</code><code>"username"</code><code>&gt;Username:&lt;/</code><code>label</code><code>&gt;</code></span></span></div>
<div><code>070.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>input</code> <code>class</code><code>=</code><code>"field"</code> <code>type</code><code>=</code><code>"text"</code> <code>name</code><code>=</code><code>"username"</code> <code>id</code><code>=</code><code>"username"</code> <code>value</code><code>=</code><code>""</code> <code>size</code><code>=</code><code>"23"</code> <code>/&gt;</code></span></span></div>
<div><code>071.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>label</code> <code>class</code><code>=</code><code>"grey"</code> <code>for</code><code>=</code><code>"email"</code><code>&gt;Email:&lt;/</code><code>label</code><code>&gt;</code></span></span></div>
<div><code>072.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>input</code> <code>class</code><code>=</code><code>"field"</code> <code>type</code><code>=</code><code>"text"</code> <code>name</code><code>=</code><code>"email"</code> <code>id</code><code>=</code><code>"email"</code> <code>size</code><code>=</code><code>"23"</code> <code>/&gt;</code></span></span></div>
<div><code>073.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>label</code><code>&gt;A password will be e-mailed to you.&lt;/</code><code>label</code><code>&gt;</code></span></span></div>
<div><code>074.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>input</code> <code>type</code><code>=</code><code>"submit"</code> <code>name</code><code>=</code><code>"submit"</code> <code>value</code><code>=</code><code>"Register"</code> <code>class</code><code>=</code><code>"bt_register"</code> <code>/&gt;</code></span></span></div>
<div><code>075.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>form</code><code>&gt;</code></span></span></div>
<div><code>076.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>077.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>078.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>079.</code><span><span style="margin-left: 0px ! important;"><code>&lt;?</code><code>php</code></span></span></div>
<div><code>080.</code><span><span style="margin-left: 0px ! important;"><code>else:</code></span></span></div>
<div><code>081.</code><span><span style="margin-left: 0px ! important;"><code>// If you are logged in</code></span></span></div>
<div><code>082.</code><span><span style="margin-left: 0px ! important;"><code>?&gt;</code></span></span></div>
<div><code>083.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>084.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"left"</code><code>&gt;</code></span></span></div>
<div><code>085.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>h1</code><code>&gt;Members panel&lt;/</code><code>h1</code><code>&gt;</code></span></span></div>
<div><code>086.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>p</code><code>&gt;You can put member-only data here&lt;/</code><code>p</code><code>&gt;</code></span></span></div>
<div><code>087.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>a</code> <code>href</code><code>=</code><code>"registered.php"</code><code>&gt;View a special member page&lt;/</code><code>a</code><code>&gt;</code></span></span></div>
<div><code>088.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>p</code><code>&gt;- or -&lt;/</code><code>p</code><code>&gt;</code></span></span></div>
<div><code>089.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>a</code> <code>href</code><code>=</code><code>"?logoff"</code><code>&gt;Log off&lt;/</code><code>a</code><code>&gt;</code></span></span></div>
<div><code>090.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>091.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"left right"</code><code>&gt;</code></span></span></div>
<div><code>092.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>093.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>094.</code><span><span style="margin-left: 0px ! important;"><code>&lt;?</code><code>php</code></span></span></div>
<div><code>095.</code><span><span style="margin-left: 0px ! important;"><code>endif;</code></span></span></div>
<div><code>096.</code><span><span style="margin-left: 0px ! important;"><code>// Closing the IF-ELSE construct</code></span></span></div>
<div><code>097.</code><span><span style="margin-left: 0px ! important;"><code>?&gt;</code></span></span></div>
<div><code>098.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>099.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>100.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt; </code><code>&lt;!-- /login --&gt;</code></span></span></div>
<div><code>101.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>102.</code><span><span style="margin-left: 0px ! important;"><code>&lt;!-- The tab on top --&gt;</code></span></span></div>
<div><code>103.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"tab"</code><code>&gt;</code></span></span></div>
<div><code>104.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>ul</code> <code>class</code><code>=</code><code>"login"</code><code>&gt;</code></span></span></div>
<div><code>105.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>li</code> <code>class</code><code>=</code><code>"left"</code><code>&gt;&amp;nbsp;&lt;/</code><code>li</code><code>&gt;</code></span></span></div>
<div><code>106.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>li</code><code>&gt;Hello &lt;?</code><code>php</code> <code>echo $_SESSION['usr'] ? $_SESSION['usr'] : 'Guest';?&gt;!&lt;/</code><code>li</code><code>&gt;</code></span></span></div>
<div><code>107.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>li</code> <code>class</code><code>=</code><code>"sep"</code><code>&gt;|&lt;/</code><code>li</code><code>&gt;</code></span></span></div>
<div><code>108.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>li</code> <code>id</code><code>=</code><code>"toggle"</code><code>&gt;</code></span></span></div>
<div><code>109.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>a</code> <code>id</code><code>=</code><code>"open"</code> <code>class</code><code>=</code><code>"open"</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;&lt;?</code><code>php</code> <code>echo $_SESSION['id']?'Open Panel':'Log In | Register';?&gt;&lt;/</code><code>a</code><code>&gt;</code></span></span></div>
<div><code>110.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>a</code> <code>id</code><code>=</code><code>"close"</code> <code>style</code><code>=</code><code>"display: none;"</code> <code>class</code><code>=</code><code>"close"</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;Close Panel&lt;/</code><code>a</code><code>&gt;</code></span></span></div>
<div><code>111.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>li</code><code>&gt;</code></span></span></div>
<div><code>112.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>li</code> <code>class</code><code>=</code><code>"right"</code><code>&gt;&amp;nbsp;&lt;/</code><code>li</code><code>&gt;</code></span></span></div>
<div><code>113.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>ul</code><code>&gt;</code></span></span></div>
<div><code>114.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>115.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt; </code><code>&lt;!-- / top --&gt;</code></span></span></div>
<div><code>116.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt; </code><code>&lt;!--panel --&gt;</code></span></span></div>
</div>
</div>
<p>At several places in this code, there are some PHP operators that check whether <strong>$_SESSION['usr']</strong> or <strong>$_SESSION['id']</strong> are defined. This is true only if the page visitor is logged in the site, which allows us to show specific content to site members. We will cover it in detail in a moment.</p>
<p>After the form, we put the rest of the page.</p>
<div id="highlighter_184889">
<div>
<div><a style="width: 16px; height: 16px;" title="view source" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#viewSource">view source</a><a style="width: 16px; height: 16px;" title="print" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#printSource">print</a><a style="width: 16px; height: 16px;" title="?" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#about">?</a></div>
</div>
<div>
<div><code>01.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"pageContent"</code><code>&gt;</code></span></span></div>
<div><code>02.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>03.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>id</code><code>=</code><code>"main"</code><code>&gt;</code></span></span></div>
<div><code>04.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>05.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"container"</code><code>&gt;</code></span></span></div>
<div><code>06.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>h1</code><code>&gt;A Cool Login System&lt;/</code><code>h1</code><code>&gt;</code></span></span></div>
<div><code>07.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>h2</code><code>&gt;Easy registration management with PHP &amp;amp; jQuery&lt;/</code><code>h2</code><code>&gt;</code></span></span></div>
<div><code>08.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>09.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>10.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"container"</code><code>&gt;</code></span></span></div>
<div><code>11.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>p</code><code>&gt;This is a ...&lt;/</code><code>p</code><code>&gt;</code></span></span></div>
<div><code>12.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"clear"</code><code>&gt;&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>13.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>14.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
<div><code>15.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>16.</code><span><span style="margin-left: 0px ! important;"><code>&lt;/</code><code>div</code><code>&gt;</code></span></span></div>
</div>
</div>
<p>Nothing special here. Lets continue with the PHP backend.</p>
<div id="attachment_455" style="width: 610px;"><img title="The login system" src="http://tutorialzine.com/wp-content/uploads/2009/10/i21.png" alt="The login system" width="600" height="230" />The login system</div>
<h3>Step 3 – PHP</h3>
<p>It is time to convert the form into a complete registration and login system. To achieve it, we will need more than the usual amount of PHP. I’ll divide the code into two parts.</p>
<p>If you plan to add more code, it would be a good idea to split it into several files which are included when needed. This aids the development of large projects and allows code reuse in different parts of a site.</p>
<p>But lets see how we’ve done it here.</p>
<h4>demo.php</h4>
<div id="highlighter_189417">
<div>
<div><a style="width: 16px; height: 16px;" title="view source" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#viewSource">view source</a><a style="width: 16px; height: 16px;" title="print" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#printSource">print</a><a style="width: 16px; height: 16px;" title="?" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#about">?</a></div>
</div>
<div>
<div><code>01.</code><span><span style="margin-left: 0px ! important;"><code>define(</code><code>'INCLUDE_CHECK'</code><code>,true);</code></span></span></div>
<div><code>02.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>03.</code><span><span style="margin-left: 0px ! important;"><code>require</code> <code>'connect.php'</code><code>;</code></span></span></div>
<div><code>04.</code><span><span style="margin-left: 0px ! important;"><code>require</code> <code>'functions.php'</code><code>;</code></span></span></div>
<div><code>05.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>06.</code><span><span style="margin-left: 0px ! important;"><code>// Those two files can be included only if INCLUDE_CHECK is defined</code></span></span></div>
<div><code>07.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>08.</code><span><span style="margin-left: 0px ! important;"><code>session_name(</code><code>'tzLogin'</code><code>);</code></span></span></div>
<div><code>09.</code><span><span style="margin-left: 0px ! important;"><code>// Starting the session</code></span></span></div>
<div><code>10.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>11.</code><span><span style="margin-left: 0px ! important;"><code>session_set_cookie_params(2*7*24*60*60);</code></span></span></div>
<div><code>12.</code><span><span style="margin-left: 0px ! important;"><code>// Making the cookie live for 2 weeks</code></span></span></div>
<div><code>13.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>14.</code><span><span style="margin-left: 0px ! important;"><code>session_start();</code></span></span></div>
<div><code>15.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>16.</code><span><span style="margin-left: 0px ! important;"><code>if</code><code>(</code><code>$_SESSION</code><code>[</code><code>'id'</code><code>] &amp;&amp; !isset(</code><code>$_COOKIE</code><code>[</code><code>'tzRemember'</code><code>]) &amp;&amp; !</code><code>$_SESSION</code><code>[</code><code>'rememberMe'</code><code>])</code></span></span></div>
<div><code>17.</code><span><span style="margin-left: 0px ! important;"><code>{</code></span></span></div>
<div><code>18.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// If you are logged in, but you don't have the tzRemember cookie (browser restart)</code></span></span></div>
<div><code>19.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// and you have not checked the rememberMe checkbox:</code></span></span></div>
<div><code>20.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>21.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>$_SESSION</code> <code>= </code><code>array</code><code>();</code></span></span></div>
<div><code>22.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>session_destroy();</code></span></span></div>
<div><code>23.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>24.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// Destroy the session</code></span></span></div>
<div><code>25.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>26.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>27.</code><span><span style="margin-left: 0px ! important;"><code>if</code><code>(isset(</code><code>$_GET</code><code>[</code><code>'logoff'</code><code>]))</code></span></span></div>
<div><code>28.</code><span><span style="margin-left: 0px ! important;"><code>{</code></span></span></div>
<div><code>29.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>$_SESSION</code> <code>= </code><code>array</code><code>();</code></span></span></div>
<div><code>30.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>session_destroy();</code></span></span></div>
<div><code>31.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>header(</code><code>"Location: demo.php"</code><code>);</code></span></span></div>
<div><code>32.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>exit</code><code>;</code></span></span></div>
<div><code>33.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>34.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>35.</code><span><span style="margin-left: 0px ! important;"><code>if</code><code>(</code><code>$_POST</code><code>[</code><code>'submit'</code><code>]==</code><code>'Login'</code><code>)</code></span></span></div>
<div><code>36.</code><span><span style="margin-left: 0px ! important;"><code>{</code></span></span></div>
<div><code>37.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// Checking whether the Login form has been submitted</code></span></span></div>
<div><code>38.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>39.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>$err</code> <code>= </code><code>array</code><code>();</code></span></span></div>
<div><code>40.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// Will hold our errors</code></span></span></div>
<div><code>41.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>42.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>if</code><code>(!</code><code>$_POST</code><code>[</code><code>'username'</code><code>] || !</code><code>$_POST</code><code>[</code><code>'password'</code><code>])</code></span></span></div>
<div><code>43.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$err</code><code>[] = </code><code>'All the fields must be filled in!'</code><code>;</code></span></span></div>
<div><code>44.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>45.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>if</code><code>(!</code><code>count</code><code>(</code><code>$err</code><code>))</code></span></span></div>
<div><code>46.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>{</code></span></span></div>
<div><code>47.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$_POST</code><code>[</code><code>'username'</code><code>] = mysql_real_escape_string(</code><code>$_POST</code><code>[</code><code>'username'</code><code>]);</code></span></span></div>
<div><code>48.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$_POST</code><code>[</code><code>'password'</code><code>] = mysql_real_escape_string(</code><code>$_POST</code><code>[</code><code>'password'</code><code>]);</code></span></span></div>
<div><code>49.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$_POST</code><code>[</code><code>'rememberMe'</code><code>] = (int)</code><code>$_POST</code><code>[</code><code>'rememberMe'</code><code>];</code></span></span></div>
<div><code>50.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>51.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>// Escaping all input data</code></span></span></div>
<div><code>52.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>53.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$row</code> <code>= mysql_fetch_assoc(mysql_query(</code><code>"SELECT id,usr FROM tz_members WHERE usr='{$_POST['username']}' AND pass='"</code><code>.md5(</code><code>$_POST</code><code>['password</code><code>'])."'</code><code>"));</code></span></span></div>
<div><code>54.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>55.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>if</code><code>(</code><code>$row</code><code>[</code><code>'usr'</code><code>])</code></span></span></div>
<div><code>56.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>{</code></span></span></div>
<div><code>57.</code><span><code> </code><span style="margin-left: 84px ! important;"><code>// If everything is OK login</code></span></span></div>
<div><code>58.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>59.</code><span><code> </code><span style="margin-left: 84px ! important;"><code>$_SESSION</code><code>[</code><code>'usr'</code><code>]=</code><code>$row</code><code>[</code><code>'usr'</code><code>];</code></span></span></div>
<div><code>60.</code><span><code> </code><span style="margin-left: 84px ! important;"><code>$_SESSION</code><code>[</code><code>'id'</code><code>] = </code><code>$row</code><code>[</code><code>'id'</code><code>];</code></span></span></div>
<div><code>61.</code><span><code> </code><span style="margin-left: 84px ! important;"><code>$_SESSION</code><code>[</code><code>'rememberMe'</code><code>] = </code><code>$_POST</code><code>[</code><code>'rememberMe'</code><code>];</code></span></span></div>
<div><code>62.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>63.</code><span><code> </code><span style="margin-left: 84px ! important;"><code>// Store some data in the session</code></span></span></div>
<div><code>64.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>65.</code><span><code> </code><span style="margin-left: 84px ! important;"><code>setcookie(</code><code>'tzRemember'</code><code>,</code><code>$_POST</code><code>[</code><code>'rememberMe'</code><code>]);</code></span></span></div>
<div><code>66.</code><span><code> </code><span style="margin-left: 84px ! important;"><code>// We create the tzRemember cookie</code></span></span></div>
<div><code>67.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>}</code></span></span></div>
<div><code>68.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>else</code> <code>$err</code><code>[]=</code><code>'Wrong username and/or password!'</code><code>;</code></span></span></div>
<div><code>69.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>}</code></span></span></div>
<div><code>70.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>71.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>if</code><code>(</code><code>$err</code><code>)</code></span></span></div>
<div><code>72.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$_SESSION</code><code>[</code><code>'msg'</code><code>][</code><code>'login-err'</code><code>] = implode(</code><code>'&lt;br /&gt;'</code><code>,</code><code>$err</code><code>);</code></span></span></div>
<div><code>73.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>// Save the error messages in the session</code></span></span></div>
<div><code>74.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>75.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>header(</code><code>"Location: demo.php"</code><code>);</code></span></span></div>
<div><code>76.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>exit</code><code>;</code></span></span></div>
<div><code>77.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
</div>
</div>
<p>Here the <strong>tzRemember</strong> cookie acts as a control whether we should log-off users that have not marked the “remember me” checkbox. If the cookie is not present (due to browser restart) and the visitor has not checked the remember me option, we destroy the session.</p>
<p>The session itself is kept alive for two weeks (as set by <strong>session_set_cookie_params</strong>).</p>
<p>Lets see the second part of <strong>demo.php</strong>.</p>
<div id="highlighter_622366">
<div>
<div><a style="width: 16px; height: 16px;" title="view source" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#viewSource">view source</a><a style="width: 16px; height: 16px;" title="print" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#printSource">print</a><a style="width: 16px; height: 16px;" title="?" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#about">?</a></div>
</div>
<div>
<div><code>01.</code><span><span style="margin-left: 0px ! important;"><code>else</code> <code>if</code><code>(</code><code>$_POST</code><code>[</code><code>'submit'</code><code>]==</code><code>'Register'</code><code>)</code></span></span></div>
<div><code>02.</code><span><span style="margin-left: 0px ! important;"><code>{</code></span></span></div>
<div><code>03.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// If the Register form has been submitted</code></span></span></div>
<div><code>04.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>$err</code> <code>= </code><code>array</code><code>();</code></span></span></div>
<div><code>05.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>06.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>if</code><code>(</code><code>strlen</code><code>(</code><code>$_POST</code><code>[</code><code>'username'</code><code>])&lt;4 || </code><code>strlen</code><code>(</code><code>$_POST</code><code>[</code><code>'username'</code><code>])&gt;32)</code></span></span></div>
<div><code>07.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>{</code></span></span></div>
<div><code>08.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$err</code><code>[]=</code><code>'Your username must be between 3 and 32 characters!'</code><code>;</code></span></span></div>
<div><code>09.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>}</code></span></span></div>
<div><code>10.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>11.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>if</code><code>(preg_match(</code><code>'/[^a-z0-9\-\_\.]+/i'</code><code>,</code><code>$_POST</code><code>[</code><code>'username'</code><code>]))</code></span></span></div>
<div><code>12.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>{</code></span></span></div>
<div><code>13.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$err</code><code>[]=</code><code>'Your username contains invalid characters!'</code><code>;</code></span></span></div>
<div><code>14.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>}</code></span></span></div>
<div><code>15.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>16.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>if</code><code>(!checkEmail(</code><code>$_POST</code><code>[</code><code>'email'</code><code>]))</code></span></span></div>
<div><code>17.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>{</code></span></span></div>
<div><code>18.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$err</code><code>[]=</code><code>'Your email is not valid!'</code><code>;</code></span></span></div>
<div><code>19.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>}</code></span></span></div>
<div><code>20.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>21.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>if</code><code>(!</code><code>count</code><code>(</code><code>$err</code><code>))</code></span></span></div>
<div><code>22.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>{</code></span></span></div>
<div><code>23.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>// If there are no errors</code></span></span></div>
<div><code>24.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$pass</code> <code>= </code><code>substr</code><code>(md5(</code><code>$_SERVER</code><code>[</code><code>'REMOTE_ADDR'</code><code>].microtime().rand(1,100000)),0,6);</code></span></span></div>
<div><code>25.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>// Generate a random password</code></span></span></div>
<div><code>26.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>27.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$_POST</code><code>[</code><code>'email'</code><code>] = mysql_real_escape_string(</code><code>$_POST</code><code>[</code><code>'email'</code><code>]);</code></span></span></div>
<div><code>28.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$_POST</code><code>[</code><code>'username'</code><code>] = mysql_real_escape_string(</code><code>$_POST</code><code>[</code><code>'username'</code><code>]);</code></span></span></div>
<div><code>29.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>// Escape the input data</code></span></span></div>
<div><code>30.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>31.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>mysql_query("   INSERT INTO tz_members(usr,pass,email,regIP,dt)</code></span></span></div>
<div><code>32.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>VALUES(</code></span></span></div>
<div><code>33.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>'".$_POST['</code><code>username</code><code>']."'</code><code>,</code></span></span></div>
<div><code>34.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>'".md5($pass)."'</code><code>,</code></span></span></div>
<div><code>35.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>'".$_POST['</code><code>email</code><code>']."'</code><code>,</code></span></span></div>
<div><code>36.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>'".$_SERVER['</code><code>REMOTE_ADDR</code><code>']."'</code><code>,</code></span></span></div>
<div><code>37.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>NOW()</code></span></span></div>
<div><code>38.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>)");</code></span></span></div>
<div><code>39.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>40.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>if</code><code>(mysql_affected_rows(</code><code>$link</code><code>)==1)</code></span></span></div>
<div><code>41.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>{</code></span></span></div>
<div><code>42.</code><span><code> </code><span style="margin-left: 84px ! important;"><code>send_mail( </code><code>'demo-test@tutorialzine.com'</code><code>,</code></span></span></div>
<div><code>43.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>$_POST</code><code>[</code><code>'email'</code><code>],</code></span></span></div>
<div><code>44.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>'Registration System Demo - Your New Password'</code><code>,</code></span></span></div>
<div><code>45.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>'Your password is: '</code><code>.</code><code>$pass</code><code>);</code></span></span></div>
<div><code>46.</code><span><code> </code><span style="margin-left: 140px ! important;"><code>$_SESSION</code><code>[</code><code>'msg'</code><code>][</code><code>'reg-success'</code><code>]=</code><code>'We sent you an email with your new password!'</code><code>;</code></span></span></div>
<div><code>47.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>}</code></span></span></div>
<div><code>48.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>else</code> <code>$err</code><code>[]=</code><code>'This username is already taken!'</code><code>;</code></span></span></div>
<div><code>49.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>}</code></span></span></div>
<div><code>50.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>51.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>if</code><code>(</code><code>count</code><code>(</code><code>$err</code><code>))</code></span></span></div>
<div><code>52.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>{</code></span></span></div>
<div><code>53.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$_SESSION</code><code>[</code><code>'msg'</code><code>][</code><code>'reg-err'</code><code>] = implode(</code><code>'&lt;br /&gt;'</code><code>,</code><code>$err</code><code>);</code></span></span></div>
<div><code>54.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>}</code></span></span></div>
<div><code>55.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>56.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>header(</code><code>"Location: demo.php"</code><code>);</code></span></span></div>
<div><code>57.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>exit</code><code>;</code></span></span></div>
<div><code>58.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>59.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>60.</code><span><span style="margin-left: 0px ! important;"><code>$script</code> <code>= </code><code>''</code><code>;</code></span></span></div>
<div><code>61.</code><span><span style="margin-left: 0px ! important;"><code>if</code><code>(</code><code>$_SESSION</code><code>[</code><code>'msg'</code><code>])</code></span></span></div>
<div><code>62.</code><span><span style="margin-left: 0px ! important;"><code>{</code></span></span></div>
<div><code>63.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>// The script below shows the sliding panel on page load</code></span></span></div>
<div><code>64.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>$script</code> <code>= '</code></span></span></div>
<div><code>65.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>&lt;script type=</code><code>"text/javascript"</code><code>&gt;</code></span></span></div>
<div><code>66.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>$(</code><code>function</code><code>(){</code></span></span></div>
<div><code>67.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$(</code><code>"div#panel"</code><code>).show();</code></span></span></div>
<div><code>68.</code><span><code> </code><span style="margin-left: 56px ! important;"><code>$(</code><code>"#toggle a"</code><code>).toggle();</code></span></span></div>
<div><code>69.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>});</code></span></span></div>
<div><code>70.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>&lt;/script&gt;';</code></span></span></div>
<div><code>71.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
</div>
</div>
<p>We store all the encountered errors in an <strong>$err</strong> array, which is later assigned to a <strong>$_SESSION </strong>variable. This allows it to be accessible after a browser redirect.</p>
<p>You may have noticed on some sites, that when you submit a form and later refresh the page, the data is sent all over again. This could become problematic as it could lead to a double registrations and unnecessary server load.</p>
<p>We use the header function to prevent this, by redirecting the browser to the same page. This starts a fresh view of the page, without the browser associating it with a form submit. The result is that, on page refresh, no data is sent.</p>
<p>But as we use <strong>$_SESSION</strong> to store all the encountered errors it is important that we <strong>unset</strong> these variables, once we show the errors to the user. Otherwise they will be shown on every page view (the highlighted lines on the XHTML part of the tutorial).</p>
<p>Also notice how we create an additional script (lines 60-70 of the second part of the PHP code) which shows the panel on page load, so that the messages are visible to the user.</p>
<p>Now lets take a look at the CSS.</p>
<div id="attachment_454" style="width: 610px;"><img title="The registration / login system" src="http://tutorialzine.com/wp-content/uploads/2009/10/i12.png" alt="The registration / login system" width="600" height="460" />The registration / login system</div>
<h3>Step 4 – CSS</h3>
<p>The sliding panel comes with its own style sheet. This means we are only left with creating the page styles.</p>
<h4>demo.css</h4>
<div id="highlighter_450926">
<div>
<div><a style="width: 16px; height: 16px;" title="view source" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#viewSource">view source</a><a style="width: 16px; height: 16px;" title="print" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#printSource">print</a><a style="width: 16px; height: 16px;" title="?" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#about">?</a></div>
</div>
<div>
<div><code>01.</code><span><span style="margin-left: 0px ! important;"><code>body,h</code><code>1</code><code>,h</code><code>2</code><code>,h</code><code>3</code><code>,p,quote,</code><code>small</code><code>,form,input,ul,li,ol,label{</code></span></span></div>
<div><code>02.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>/* The reset rules */</code></span></span></div>
<div><code>03.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>margin</code><code>:</code><code>0px</code><code>;</code></span></span></div>
<div><code>04.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>padding</code><code>:</code><code>0px</code><code>;</code></span></span></div>
<div><code>05.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>06.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>07.</code><span><span style="margin-left: 0px ! important;"><code>body{</code></span></span></div>
<div><code>08.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>color</code><code>:</code><code>#555555</code><code>;</code></span></span></div>
<div><code>09.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>font-size</code><code>:</code><code>13px</code><code>;</code></span></span></div>
<div><code>10.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>background</code><code>: </code><code>#eeeeee</code><code>;</code></span></span></div>
<div><code>11.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>font-family</code><code>:</code><code>Arial</code><code>, </code><code>Helvetica</code><code>, </code><code>sans-serif</code><code>;</code></span></span></div>
<div><code>12.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>width</code><code>: </code><code>100%</code><code>;</code></span></span></div>
<div><code>13.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>14.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>15.</code><span><span style="margin-left: 0px ! important;"><code>h</code><code>1</code><code>{</code></span></span></div>
<div><code>16.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>font-size</code><code>:</code><code>28px</code><code>;</code></span></span></div>
<div><code>17.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>font-weight</code><code>:</code><code>bold</code><code>;</code></span></span></div>
<div><code>18.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>font-family</code><code>:</code><code>"Trebuchet MS"</code><code>,</code><code>Arial</code><code>, </code><code>Helvetica</code><code>, </code><code>sans-serif</code><code>;</code></span></span></div>
<div><code>19.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>letter-spacing</code><code>:</code><code>1px</code><code>;</code></span></span></div>
<div><code>20.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>21.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>22.</code><span><span style="margin-left: 0px ! important;"><code>h</code><code>2</code><code>{</code></span></span></div>
<div><code>23.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>font-family</code><code>:</code><code>"Arial Narrow"</code><code>,</code><code>Arial</code><code>,</code><code>Helvetica</code><code>,</code><code>sans-serif</code><code>;</code></span></span></div>
<div><code>24.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>font-size</code><code>:</code><code>10px</code><code>;</code></span></span></div>
<div><code>25.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>font-weight</code><code>:</code><code>normal</code><code>;</code></span></span></div>
<div><code>26.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>letter-spacing</code><code>:</code><code>1px</code><code>;</code></span></span></div>
<div><code>27.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>padding-left</code><code>:</code><code>2px</code><code>;</code></span></span></div>
<div><code>28.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>text-transform</code><code>:</code><code>uppercase</code><code>;</code></span></span></div>
<div><code>29.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>white-space</code><code>:</code><code>nowrap</code><code>;</code></span></span></div>
<div><code>30.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>margin-top</code><code>:</code><code>4px</code><code>;</code></span></span></div>
<div><code>31.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>color</code><code>:</code><code>#888888</code><code>;</code></span></span></div>
<div><code>32.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>33.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>34.</code><span><span style="margin-left: 0px ! important;"><code>#main p{</code></span></span></div>
<div><code>35.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>padding-bottom</code><code>:</code><code>8px</code><code>;</code></span></span></div>
<div><code>36.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>37.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>38.</code><span><span style="margin-left: 0px ! important;"><code>.clear{</code></span></span></div>
<div><code>39.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>clear</code><code>:</code><code>both</code><code>;</code></span></span></div>
<div><code>40.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>41.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>42.</code><span><span style="margin-left: 0px ! important;"><code>#main{</code></span></span></div>
<div><code>43.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>width</code><code>:</code><code>800px</code><code>;</code></span></span></div>
<div><code>44.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>/* Centering it in the middle of the page */</code></span></span></div>
<div><code>45.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>margin</code><code>:</code><code>60px</code> <code>auto</code><code>;</code></span></span></div>
<div><code>46.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>47.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>48.</code><span><span style="margin-left: 0px ! important;"><code>.container{</code></span></span></div>
<div><code>49.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>margin-top</code><code>:</code><code>20px</code><code>;</code></span></span></div>
<div><code>50.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>51.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>background</code><code>:</code><code>#FFFFFF</code><code>;</code></span></span></div>
<div><code>52.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>border</code><code>:</code><code>1px</code> <code>solid</code> <code>#E0E0E0</code><code>;</code></span></span></div>
<div><code>53.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>padding</code><code>:</code><code>15px</code><code>;</code></span></span></div>
<div><code>54.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>55.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>/* Rounded corners */</code></span></span></div>
<div><code>56.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>-moz-border-radius:</code><code>20px</code><code>;</code></span></span></div>
<div><code>57.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>-khtml-border-radius: </code><code>20px</code><code>;</code></span></span></div>
<div><code>58.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>-webkit-border-radius: </code><code>20px</code><code>;</code></span></span></div>
<div><code>59.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>border-radius:</code><code>20px</code><code>;</code></span></span></div>
<div><code>60.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>61.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>62.</code><span><span style="margin-left: 0px ! important;"><code>.err{</code></span></span></div>
<div><code>63.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>color</code><code>:</code><code>red</code><code>;</code></span></span></div>
<div><code>64.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>65.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>66.</code><span><span style="margin-left: 0px ! important;"><code>.success{</code></span></span></div>
<div><code>67.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>color</code><code>:</code><code>#00CC00</code><code>;</code></span></span></div>
<div><code>68.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>69.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>70.</code><span><span style="margin-left: 0px ! important;"><code>a, a:visited {</code></span></span></div>
<div><code>71.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>color</code><code>:</code><code>#00BBFF</code><code>;</code></span></span></div>
<div><code>72.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>text-decoration</code><code>:</code><code>none</code><code>;</code></span></span></div>
<div><code>73.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>outline</code><code>:</code><code>none</code><code>;</code></span></span></div>
<div><code>74.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>75.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>76.</code><span><span style="margin-left: 0px ! important;"><code>a:hover{</code></span></span></div>
<div><code>77.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>text-decoration</code><code>:</code><code>underline</code><code>;</code></span></span></div>
<div><code>78.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
<div><code>79.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>80.</code><span><span style="margin-left: 0px ! important;"><code>.tutorial-info{</code></span></span></div>
<div><code>81.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>text-align</code><code>:</code><code>center</code><code>;</code></span></span></div>
<div><code>82.</code><span><code> </code><span style="margin-left: 28px ! important;"><code>padding</code><code>:</code><code>10px</code><code>;</code></span></span></div>
<div><code>83.</code><span><span style="margin-left: 0px ! important;"><code>}</code></span></span></div>
</div>
</div>
<h3>Step 5 – jQuery</h3>
<p>The sliding panel comes with its own jQuery files.</p>
<h4>demo.php</h4>
<div id="highlighter_312230">
<div>
<div><a style="width: 16px; height: 16px;" title="view source" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#viewSource">view source</a><a style="width: 16px; height: 16px;" title="print" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#printSource">print</a><a style="width: 16px; height: 16px;" title="?" href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/#about">?</a></div>
</div>
<div>
<div><code>01.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>script</code> <code>type</code><code>=</code><code>"text/javascript"</code> <code>src</code><code>=</code><code>"<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js</a>"</code><code>&gt;&lt;/</code><code>script</code><code>&gt;</code></span></span></div>
<div><code>02.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>03.</code><span><span style="margin-left: 0px ! important;"><code>&lt;!-- PNG FIX for IE6 --&gt;</code></span></span></div>
<div><code>04.</code><span><span style="margin-left: 0px ! important;"><code>&lt;!-- <a href="http://24ways.org/2007/supersleight-transparent-png-in-ie6">http://24ways.org/2007/supersleight-transparent-png-in-ie6</a> --&gt;</code></span></span></div>
<div><code>05.</code><span><span style="margin-left: 0px ! important;"><code>&lt;!--[if lte IE 6]&gt;</code></span></span></div>
<div><code>06.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>script</code> <code>type</code><code>=</code><code>"text/javascript"</code> <code>src</code><code>=</code><code>"login_panel/js/pngfix/supersleight-min.js"</code><code>&gt;&lt;/</code><code>script</code><code>&gt;</code></span></span></div>
<div><code>07.</code><span><span style="margin-left: 0px ! important;"><code>&lt;![endif]--&gt;</code></span></span></div>
<div><code>08.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>09.</code><span><span style="margin-left: 0px ! important;"><code>&lt;</code><code>script</code> <code>src</code><code>=</code><code>"login_panel/js/slide.js"</code> <code>type</code><code>=</code><code>"text/javascript"</code><code>&gt;&lt;/</code><code>script</code><code>&gt;</code></span></span></div>
<div><code>10.</code><span><span style="margin-left: 0px ! important;"> </span></span></div>
<div><code>11.</code><span><span style="margin-left: 0px ! important;"><code>&lt;?</code><code>php</code> <code>echo $script; ?&gt;</code></span></span></div>
</div>
</div>
<p>First we include the jQuery library from Google’s CDN. Later comes a special fix for IE6 PNG transparency issues and lastly the panel’s script is included.</p>
<p>At the bottom of the page is the $script variable – it shows the panel on page load if needed.</p>
<p>With this our cool login system is complete!</p>
<h3>Conclusion</h3>
<p>Today we learned how to use a fantastic form component and turn it into a functional log in / registration system.</p>
<p>You are free to built upon this code and modify it any way you see fit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/making-a-cool-login-system-with-php-mysql-u0026amp-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 Cool Ways to Add Graphs to Your Website</title>
		<link>http://www.learningjquery.org/index.php/5-cool-ways-to-add-graphs-to-your-website/</link>
		<comments>http://www.learningjquery.org/index.php/5-cool-ways-to-add-graphs-to-your-website/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 03:06:37 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/index.php/2009/10/19/5-cool-ways-to-add-graphs-to-your-website/</guid>
		<description><![CDATA[
Graphs, charts and diagrams can be used to visually describe data. Visualizing data is very important, as it helps the reader to understand the data even better. And even though some people might prefer viewing data in a table, I think we are many who feel more comfortable in viewing data graphically. Fortunately for us, [...]]]></description>
			<content:encoded><![CDATA[<p><a title="5 Cool Ways to Add Graphs to Your Website" href="http://stiern.com/articles/5-cool-ways-to-add-graphs-to-your-website"><img src="http://stiern.com/site/wp-content/everything/graphs.png" alt="5 Cool Ways to Add Graphs to Your Website" width="500px" /></a></p>
<p>Graphs, charts and diagrams can be used to visually describe data. Visualizing data is very important, as it helps the reader to understand the data even better. And even though some people might prefer viewing data in a table, I think we are many who feel more comfortable in viewing data graphically. Fortunately for us, there are several ways you can implement data into a graph on a website.</p>
<p><span id="more-585"> </span></p>
<p>Basically, you have two main options; You can use Flash, or you can use jQuery. What you prefer is entirely up to you, but I’d like to show you some of the possibilities within each technology.</p>
<h3>Open Flash Chart</h3>
<div id="attachment_594" style="width: 510px;"><a title="Open Flash Chart" href="http://stiern.com/site/wp-content/everything/ofc.png"><img title="Open Flash Chart" src="http://stiern.com/site/wp-content/everything/ofc.png" alt="" width="500" height="186" /></a>An example of a bar chart made with Open Flash Chart</div>
<p>Open Flash Chart is—as the name states—a Flash chart. If you run a WordPress blog, you might know it from the <a title="WordPress.com Stats Plugin" onclick="javascript:pageTracker._trackPageview('/outbound/article/wordpress.org');" href="http://wordpress.org/extend/plugins/stats/">WordPress.com Stats Plugin</a>. It is open source, and there are lots of customization options. You can make almost any kind of chart you can imagine, and it’s fairly easy to setup if you just follow the <a title="Open Flash Chart tutorial" onclick="javascript:pageTracker._trackPageview('/outbound/article/teethgrinder.co.uk');" href="http://teethgrinder.co.uk/open-flash-chart-2/tutorial.php">tutorials</a> on the Open Flash Chart website. With the new Open Flash Chart 2, you can even use it with jQuery and save your graphs as images. To see examples, and to read the tutorials, visit the <a onclick="javascript:pageTracker._trackPageview('/outbound/article/teethgrinder.co.uk');" href="http://teethgrinder.co.uk/open-flash-chart-2/">Open Flash Chart website</a>.</p>
<h3>Flot</h3>
<div id="attachment_710" style="width: 510px;"><a title="An example of a Flot graph" href="http://stiern.com/site/wp-content/everything/flot.png"><img title="An example of a Flot graph" src="http://stiern.com/site/wp-content/everything/flot.png" alt="An example of a Flot graph" width="500" height="256" /></a>An example of a Flot graph</div>
<p>Next up is Flot, a jQuery based method for implementing graphs. It is hosted at <a title="Flot at Google Code" onclick="javascript:pageTracker._trackPageview('/outbound/article/code.google.com');" href="http://code.google.com/p/flot/">Google Code</a>, and it works in all the major browsers (including IE6). It comes with <a title="Flot examples" onclick="javascript:pageTracker._trackPageview('/outbound/article/people.iola.dk');" href="http://people.iola.dk/olau/flot/examples/">a great bunch of examples</a>, but the documentation could be better. The output of Flot will be a static image.</p>
<h3>jQuery Visualize Plugin</h3>
<div id="attachment_713" style="width: 510px;"><a title="An example of the jQuery Visualize Plugin." href="http://stiern.com/site/wp-content/everything/jqueryvisualize.png"><img title="An example of the jQuery Visualize Plugin." src="http://stiern.com/site/wp-content/everything/jqueryvisualize.png" alt="An example of the jQuery Visualize Plugin." width="500" height="251" /></a>An example of the jQuery Visualize Plugin.</div>
<p><a title="jQuery Visualize Plugin" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.filamentgroup.com');" href="http://www.filamentgroup.com/lab/jquery_visualize_plugin_accessible_charts_graphs_from_tables_html5_canvas/">This jQuery plugin</a> helps you implement dynamic charts into your website without using Flash. Using the HTML5 canvas element it is possible to create great-looking charts without using even images. There’s a very thorough tutorial at the site that helps you set it all up. Also, it works in every major browser.</p>
<h3>jQuery SVG</h3>
<div id="attachment_719" style="width: 510px;"><a title="An example of a bar graph made using jQuery SVG" href="http://stiern.com/site/wp-content/everything/svg.png"><img title="An example of a bar graph made using jQuery SVG" src="http://stiern.com/site/wp-content/everything/svg.png" alt="An example of a bar graph made using jQuery SVG" width="500" height="276" /></a>An example of a bar graph made using jQuery SVG</div>
<p>This is yet another jQuery plugin called <a title="jQuery SVG" onclick="javascript:pageTracker._trackPageview('/outbound/article/keith-wood.name');" href="http://keith-wood.name/svg.html">jQuery SVG</a>. It uses SVG, a language “for describing two-dimensional graphics in XML”. SVG is supported in most browsers. Actually, it is not only a graphing plugin. You can use it to create advanced graphics on your website such as text paths. Still, for graphs it is very usable.</p>
<h3>Google Chart API</h3>
<div id="attachment_721" style="width: 450px;"><a title="An example of a map chart made with Google Chart API" href="http://stiern.com/site/wp-content/everything/googlechart.png"><img title="An example of a map chart made with Google Chart API" src="http://stiern.com/site/wp-content/everything/googlechart.png" alt="An example of a map chart made with Google Chart API" width="440" height="220" /></a>An example of a map chart made with Google Chart API</div>
<p>The last method is Google’s own <a title="Chart API" onclick="javascript:pageTracker._trackPageview('/outbound/article/code.google.com');" href="http://code.google.com/apis/chart/">Chart API</a>. It is very simple, and all you get is static images. But the static images are cool. You can easily create world maps with selected countries colored in your choice of color. As with almost every Google project, the documentation is awesome. You’ll get some very fine looking graphs with little effort, and everything is customizable.</p>
<h3>Conclusion</h3>
<p>Now to the big question: Which method is the best? I don’t know. I guess it’s all about taste and what you need it for. But similar for the five mentioned methods is that you have some very great, free resources that easily lets you implement graphs into your website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/5-cool-ways-to-add-graphs-to-your-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Best Javascript Drawing and Canvas Libraries</title>
		<link>http://www.learningjquery.org/index.php/10-best-javascript-drawing-and-canvas-libraries/</link>
		<comments>http://www.learningjquery.org/index.php/10-best-javascript-drawing-and-canvas-libraries/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 01:11:58 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=121</guid>
		<description><![CDATA[
Develop Rich interactive internet applications with these javascript drawing and canvas libraries. JavaScript developers, web developers and webmasters can take advantage of these libraries to add graphics drawing functionality to their web applications or websites.
Draw2D Javascript Drawing Library
Draw2D is the graph component of the Open-jACOB web based workflow editor. The purpose of this experiment is [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-10-Best-Javascript-Drawing-and-Canvas-Libraries.png" alt="" /><br />
Develop Rich interactive internet applications with these javascript drawing and canvas libraries. JavaScript developers, web developers and webmasters can take advantage of these libraries to add graphics drawing functionality to their web applications or websites.</p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/draw2d-javascript-drawing-library/">Draw2D Javascript Drawing Library</a></h2>
<p>Draw2D is the graph component of the Open-jACOB web based workflow editor. The purpose of this experiment is to see if a Visio-type workflow editor tool could be developed in a web browser. It demonstrates that it can be done.<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-Draw2D-Javascript-Drawing-Library.png" alt="" /></p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/javascript-vector-draw-library/">JavaScript Vector-Draw Library</a></h2>
<p>How many times you wished if you could only draw an arrow on your web page? Or few lines here and there? Unfortunately, HTML offers nothing in this department, and using images takes bandwidth and slows down the loading of your pages<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-JavaScript-Vector-Draw-Library.png" alt="" /></p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/jsdraw2d-2d-graphics-library-for-javascript/">jsDraw2D : 2D Graphics Library for JavaScript</a></h2>
<p>This is a pure JavaScript library to draw 2D graphics on web pages inside web browser without using SVG or VML. JavaScript developers, web developers and webmasters can take advantage of the library to add graphics drawing functionality to their web applications or websites using the library. The library is entirely written in JavaScript and does not need any plug-in or additional software to run/execute. The JavaScript source code of the library is open and free under a LGPL License.<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-jsDraw2D-2D-Graphics-Library-for-JavaScript.png" alt="" /></p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/canvasgraph-js-graphing-in-javascript/">CanvasGraph.js : Graphing in Javascript</a></h2>
<p>Canvas Graph is a small simple javascript library that allows you to conveniently plot simple line, bar and pie charts using the new HTML Canvas Tag.<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=null" alt="" /></p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/plotkit-javascript-chart-plotting/">PlotKit – Javascript Chart Plotting</a></h2>
<p>PlotKit is a Chart and Graph Plotting Library for Javascript. It has support for HTML Canvas and also SVG via Adobe SVG Viewer and native browser support.<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-PlotKit-Javascript-Chart-Plotting.png" alt="" /></p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/raphael-javascript-drawing-library/">Raphael: javascript drawing library</a></h2>
<p>Raphael is a very slick looking JavaScript library for drawing and animating vector graphics with JavaScript. The API is simple and well thought-out and it supports all major browsers, including Internet Explorer 6.<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-Raphael-javascript-drawing-library.png" alt="" /></p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/drawing-lines-in-mozilla-based-browsers-and-the-internet-explorer/">Drawing lines in Mozilla based browsers and the Internet Explorer</a></h2>
<p>In this article, I want to explain and deduce the line drawing algorithm by Bresenham. Afterwards, I will show an optimized version which can be used to draw lines in Gecko based browsers like Mozilla or Firefox and Microsoft Internet Explorer. As you know, HTML itself is not able to describe lines. Therefore, there is no built-in features in the above-mentioned browsers for drawing lines. By implementing the Bresenham algorithm with JavaScript while applying some tricks, we will be able to draw<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-Drawing-lines-in-Mozilla-based-browsers-and-the-Internet-Explorer.png" alt="" /></p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/flotr-javascript-plotting-library/">Flotr Javascript Plotting Library</a></h2>
<p>Flotr is a javascript plotting library based on the Prototype Javascript Framework version 1.6.0.2 at the moment and inspired by Flot written by Ole Laursen.<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-Flotr-Javascript-Plotting-Library.png" alt="" /></p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/dhtml-javascript-vector-graphics-library/">DHTML, JavaScript Vector Graphics Library</a></h2>
<p>This JavaScript VectorGraphics library provides graphics capabilities for JavaScript: functions to draw circles, ellipses ovals, oblique lines, polylines and polygons for instance triangles, rectangles dynamically into a webpage. Usage of this Vector Graphics library should be easy even if you do not have JavaScript experience.<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-DHTML-JavaScript-Vector-Graphics-Library.png" alt="" /></p>
<h2><a href="http://javascript.open-libraries.com/utilities/drawing/canviz-javascript-library/">canviz JavaScript library</a></h2>
<p>Canviz is a JavaScript library for drawing Graphviz graphs to a web browser canvas. More technically, Canviz is a JavaScript xdot renderer. It works in most modern browsers.<br />
<img src="http://www.open-libraries.com/imageredirect/javascript/im.php?imagekey=wpid-canviz-JavaScript-library.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/10-best-javascript-drawing-and-canvas-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>40+轻量级JavaScript库</title>
		<link>http://www.learningjquery.org/index.php/40-lightweight-javascript-library/</link>
		<comments>http://www.learningjquery.org/index.php/40-lightweight-javascript-library/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 10:41:40 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=118</guid>
		<description><![CDATA[诸如jQuery, MooTools, Prototype, Dojo和YUI等JavaScript脚本库，大家都已经很熟悉。但这些脚本库有利也有弊——比如说JavaScript文件过大的问题。有时你可能会愿意采用一些体积小巧、专注于特定任务的JavaScript脚本库。
以下是40个轻量级的JavaScript脚本库。 供每位网页设计师和程序员作参考。
1. 表单
wForms
wForms 是一个开源的、 无入侵的(unobstrusive)注*代码库，能够简化大部分与表单相关的常用JavaScript函数。 它能对表单的用户输入值进行验证，只需为表单元素添加一个特定的类即可使用。另外，wForms 还具有强大的表单同步（例如“全选/全不选”）和条件表单（如，当x被选择则显示y）功能。
Validanguage
Validanguage 是一个无入侵的 JavaScript表单验证框架。 它有一个继承逻辑，可以全局定义，也可以对每个表单或每个元素分别定义。 利用作者提供的两个API，以及诸如综合的AJAX支持(integrated AJAX support)、缓存和调用函数等特性，该框架可以提供强健的(robust)验证体验。两个API用以高级设置，分别是加在注释里的像HTML语言的 API和基于JavaScript对象的API。
LiveValidation
LiveValidation是一个轻量级的JavaScript脚本库，提供一系列验证函数。除了经典验证法，此库还具有实时验证(live validation)特性，能根据你键入的文字实时控制特定区域。 Ruby on Rails的开发者会发现LiveValidation异常好用，因为二者的命名规范和参数设置非常相似。虽然它是独立库，不过也有一个Prototype版注*。
yav
一个功能强大、可扩展、使用灵活的表单验证代码库。yav可处理多种情况，从日期、email、整数之类的基本验证到掩码文本框和自定义正则表达式之类的高级应用，都得心应手。该库内建AJAX支持，并且可以轻易在每个对象层自定义错误显示信息。
qForms
处理表单的完全解决方案。为开发者提供诸如多样验证规则，阻止多次提交，锁定/禁用域等特性。
formreform
不用表格来实现多栏布局通常都很有挑战性。这个小巧的代码库能够把一个简单表单转换成一栏、两栏或四栏格式化布局的表单。利用formreform能自动让表单样式适应任何设计。
2. 动画
$fx()
$fx() 是一个用户为HTML元素添加动画效果的轻量级代码库。利用此库，你可以指定在一定时间内改变任何CSS属性。对于复杂动画，你可以合并效果，给各效果分组，让它们链式反应或者同时发生。你还可以为每一步动画设定不同的回调动作，进行更深入的自定义。
JSTweener
补间动画的JavaScript脚本库。它的API和著名的ActionScript补间动画引擎 Tweener 相似。你可以调用动画时间，定义形状变换方式和延迟。在几乎任何时间点（如onStart – 开始时, onComplete -完成时, onUpdate – 更新时），你都可以引发新动作。
Facebook Animation
用于创建基于CSS的自定义动画的强大代码库。利用一两行Facebook Animation，你就能改善用户界面。本代码库的语法遵循FBJS（在Facebook实用工具中使用的代码库），一旦学会，你也就具备了创建Facebook实用工具的能力！
FX
一个轻量级代码库，拥有和YUI类似的使用句法。FX可以为几乎所有CSS属性创建补间动画。支持颜色和滚动动画。你只需要设计任意对象，任意属性的起始值和结束值就够了。
3. 视觉化和图像特效
JS charts
JS charts 可以输出柱状图，饼图和曲线图。只需从一个XML文件或JavaScript数组里调用数据，它就能提供极佳的易用性。图表被输出为png图像文件。该库支持大部分流行的浏览器。
Canvas 3D JS Library (C3DL)
C3DL让编写3D应用更加容易。它提供一组算法、场景和3D对象类，对于想在浏览器里开发3D内容，但是对3D图像的深层算法不甚了了的程序员真是不小的福音。
Processing.js
这个JavaScript脚本库指向 Processing 语言 （一个用于图像、动画和交互编程的语言）。它有丰富的特性用于创建2D输出，提供形状/图像绘制方法、颜色处理、字体、对象、算法函数等等。
Rapha?l
一个极赞的代码库，简化在网页中使用矢量图形的工作。Rapha?l 利用SVG和VML来创建图像，并能为这些图像绑定动作处理器。该库功能强大，包括旋转、动画、缩放和绘制曲线、矩形、圆形等。
ImageFX
可以为图像添加特效，例如模糊、锐化、浮雕、变亮等等。ImageFX使用画布元素来创建效果。兼容所有主流浏览器（你可以在其页面看到兼容性列表）。此库简单易用，只需要在网页中插入.js文件然后用一行代码调用就够了。
Pixastic
Pixastic 使用HTML5的画布对象，此对象可以直接处理像素级数据。支持的效果包括减淡和去色、反相、翻转、亮度和对比度调节、色相和饱和度、浮雕、模糊等等等等。由于画布对象相对较新，各个浏览器对这一JavaScript脚本库的支持程度不尽相同。
Reflection.js
自动创建倒影效果的无侵入JavaScript脚本库。倒影的高度和透明度可以自定义。使用该库就像给图像添加一个“类”一样简单。在所有主流浏览器中都能正常工作，文件大小不过5 KB。
4. 数据库
Taffy DB
可以作为浏览器中的SQL数据库来使用的JavaScript，也可以看做是一个高级的“数组管理器”。在AJAX化的Web应用中，它可以工作在数据库层。你可以创建、读取、编辑和删除数据，也可以使用循环、归类以及各种高级查询方式。
ActiveRecord.js
此库支持Google Gears和Chrome，Aptana Jaxer，Adobe AIR ，以及任何支持W3C HTML5 [...]]]></description>
			<content:encoded><![CDATA[<p>诸如<a href="http://jquery.com/" target="_blank">jQuery</a>, <a href="http://mootools.net/" target="_blank">MooTools</a>, <a href="http://www.prototypejs.org/" target="_blank">Prototype</a>, <a href="http://www.dojotoolkit.org/" target="_blank">Dojo</a>和<a href="http://developer.yahoo.com/yui/" target="_blank">YUI</a>等<strong><a href="http://paranimage.com/category/dede/javascript/">JavaScript</a>脚本库</strong>，大家都已经很熟悉。但这些脚本库有利也有弊——比如说JavaScript文件过大的问题。有时你可能会愿意采用一些体积小巧、专注于特定任务的JavaScript脚本库。</p>
<p>以下是<strong>40个轻量级的JavaScript脚本库</strong>。 供每位网页设计师和程序员作参考。</p>
<h2>1. 表单</h2>
<h4><a href="http://www.formassembly.com/wForms/" target="_blank">wForms</a></h4>
<p>wForms 是一个<strong>开源的</strong>、<strong> 无入侵的(unobstrusive)</strong><strong><sup>注*</sup></strong><strong>代码库</strong>，能够简化大部分与表单相关的常用JavaScript函数。 它能对表单的用户输入值进行验证，只需为表单元素添加一个特定的类即可使用。另外，<strong>wForms</strong> 还具有强大的<strong>表单同步</strong>（例如“全选/全不选”）和<strong>条件表单</strong>（如，当x被选择则显示y）功能。</p>
<h4><a href="http://www.drlongghost.com/validanguage.php" target="_blank">Validanguage</a></h4>
<p>Validanguage 是一个无入侵的 <strong>JavaScript表单验证框架</strong>。 它有一个继承逻辑，可以全局定义，也可以对每个表单或每个元素分别定义。 利用作者提供的两个API，以及诸如综合的AJAX支持(integrated AJAX support)、缓存和调用函数等特性，该框架可以提供强健的(robust)验证体验。两个API用以高级设置，分别是加在注释里的像<a href="http://paranimage.com/category/dede/html">HTML</a>语言的 API和基于JavaScript对象的API。</p>
<h4><a href="http://www.livevalidation.com/" target="_blank">LiveValidation</a></h4>
<p>LiveValidation是一个轻量级的JavaScript脚本库，提供一系列验证函数。除了经典验证法，此库还具有实时验证(live validation)特性，能<strong>根据你键入的文字实时控制特定区域</strong>。 <strong>Ruby on Rails</strong>的开发者会发现LiveValidation异常好用，因为二者的命名规范和参数设置非常相似。虽然它是独立库，不过也有一个Prototype版<sup>注*</sup>。</p>
<h4><a href="http://yav.sourceforge.net/en/index.html" target="_blank">yav</a></h4>
<p>一个功能强大、可扩展、使用灵活的<strong>表单验证代码库</strong>。<strong>yav</strong>可处理多种情况，从日期、email、整数之类的基本验证到<a title="JavaScript Mask，利用JavaScript改变输入域在客户端的外观" href="http://www.webresourcesdepot.com/javascript-input-masks/" target="_blank">掩码文本框</a>和自定义正则表达式之类的高级应用，都得心应手。该库内建AJAX支持，并且可以轻易在每个对象层自定义错误显示信息。</p>
<h4><a href="http://www.pengoworks.com/index.cfm?action=get:qforms" target="_blank">qForms</a></h4>
<p>处理表单的完全解决方案。为开发者提供诸如多样验证规则，阻止多次提交，锁定/禁用域等特性。</p>
<h4><a href="http://code.google.com/p/formreform/" target="_blank">formreform</a></h4>
<p>不用表格来实现多栏布局通常都很有挑战性。这个小巧的代码库能够把一个简单表单转换成一栏、两栏或四栏格式化布局的表单。利用<strong>formreform</strong>能自动让表单样式适应任何设计。</p>
<h2>2. 动画</h2>
<h4><a href="http://fx.inetcat.com/" target="_blank">$fx()</a></h4>
<p><strong>$fx()</strong> 是一个用户为HTML元素添加动画效果的轻量级代码库。利用此库，你可以指定在一定时间内改变任何<a href="http://paranimage.com/category/dede/css/">CSS</a>属性。对于复杂动画，你可以合并效果，给各效果分组，让它们链式反应或者同时发生。你还可以为每一步动画设定不同的回调动作，进行更深入的自定义。</p>
<h4><a href="http://coderepos.org/share/wiki/JSTweener" target="_blank">JSTweener</a></h4>
<p>补间动画的JavaScript脚本库。它的API和著名的ActionScript补间动画引擎 <a href="http://code.google.com/p/tweener/" target="_blank">Tweener</a> 相似。你可以调用动画时间，定义形状变换方式和延迟。在几乎任何时间点（如onStart – 开始时, onComplete -完成时, onUpdate – 更新时），你都可以引发新动作。</p>
<h4><a href="http://developers.facebook.com/animation/" target="_blank">Facebook Animation</a></h4>
<p>用于创建基于CSS的自定义动画的强大代码库。利用一两行Facebook Animation，你就能改善用户界面。本代码库的语法遵循FBJS（在Facebook实用工具中使用的代码库），一旦学会，你也就具备了创建Facebook实用工具的能力！</p>
<h4><a href="http://ryanmorr.com/archives/fx-lightweight-and-standalone" target="_blank">FX</a></h4>
<p>一个轻量级代码库，拥有和YUI类似的使用句法。<strong>FX</strong>可以为几乎所有CSS属性创建补间动画。支持颜色和滚动动画。你只需要设计任意对象，任意属性的起始值和结束值就够了。</p>
<h2>3. 视觉化和图像特效</h2>
<h4><a href="http://www.jscharts.com/" target="_blank">JS charts</a></h4>
<p><strong>JS charts</strong> 可以输出柱状图，饼图和曲线图。只需从一个XML文件或JavaScript数组里调用数据，它就能提供极佳的易用性。图表被输出为png图像文件。该库支持大部分流行的浏览器。</p>
<h4><a href="http://www.c3dl.org/" target="_blank">Canvas 3D JS Library (C3DL)</a></h4>
<p><strong>C3DL</strong>让编写3D应用更加容易。它提供一组算法、场景和3D对象类，对于想在浏览器里开发3D内容，但是对3D图像的深层算法不甚了了的程序员真是不小的福音。</p>
<h4><a href="http://ejohn.org/blog/processingjs/" target="_blank">Processing.js</a></h4>
<p>这个JavaScript脚本库指向 <a href="http://processing.org/" target="_blank">Processing 语言</a> （一个用于图像、动画和交互编程的语言）。它有丰富的特性用于创建2D输出，提供形状/图像绘制方法、颜色处理、<a href="http://paranimage.com/category/resources/fonts/">字体</a>、对象、算法函数等等。</p>
<h4><a href="http://raphaeljs.com/" target="_blank">Rapha?l</a></h4>
<p>一个极赞的代码库，简化在网页中使用矢量图形的工作。Rapha?l 利用<a title="维基百科上的SVG" href="http://zh.wikipedia.org/wiki/SVG" target="_blank">SVG</a>和<a title="维基百科上的VML词条" href="http://zh.wikipedia.org/wiki/Vector_Markup_Language" target="_blank">VML</a>来创建图像，并能为这些图像绑定动作处理器。该库功能强大，包括旋转、动画、缩放和绘制曲线、矩形、圆形等。</p>
<h4><a href="http://www.nihilogic.dk/labs/imagefx/" target="_blank">ImageFX</a></h4>
<p>可以为图像添加特效，例如模糊、锐化、浮雕、变亮等等。ImageFX使用画布元素来创建效果。兼容所有主流浏览器（你可以在其页面看到兼容性列表）。此库简单易用，只需要在网页中插入.js文件然后用一行代码调用就够了。</p>
<h4><a href="http://www.pixastic.com/" target="_blank">Pixastic</a></h4>
<p><strong>Pixastic</strong> 使用HTML5的画布对象，此对象可以直接处理像素级数据。支持的效果包括减淡和去色、反相、翻转、亮度和对比度调节、色相和饱和度、浮雕、模糊等等等等。由于画布对象相对较新，各个浏览器对这一JavaScript脚本库的支持程度不尽相同。</p>
<h4><a href="http://cow.neondragon.net/stuff/reflection/" target="_blank">Reflection.js</a></h4>
<p>自动创建倒影效果的无侵入JavaScript脚本库。倒影的高度和透明度可以自定义。使用该库就像给图像添加一个“类”一样简单。在所有主流浏览器中都能正常工作，文件大小不过5 KB。</p>
<h2>4. 数据库</h2>
<h4><a href="http://taffydb.com/" target="_blank">Taffy DB</a></h4>
<p>可以作为浏览器中的SQL数据库来使用的JavaScript，也可以看做是一个高级的“数组管理器”。在AJAX化的Web应用中，它可以工作在数据库层。你可以创建、读取、编辑和删除数据，也可以使用循环、归类以及各种高级查询方式。</p>
<h4><a href="http://www.activerecordjs.org/" target="_blank">ActiveRecord.js</a></h4>
<p>此库支持Google Gears和Chrome，Aptana Jaxer，<a href="http://paranimage.com/category/appls/adobe-air/">Adobe AIR</a> ，以及任何支持W3C HTML5 SQL规范的平台（现在Webkit和<a href="http://paranimage.com/category/mobile/iphone/">iPhone</a>也支持了）。它使在JavaScript利用数据库变得简单。使用<strong>ActiveRecord.js</strong>, 你能自动创建数据表、验证和同步数据等等。</p>
<h2>5. 字符串和数学函数</h2>
<h4><a href="http://www.datejs.com/" target="_blank">Date.js</a></h4>
<p>和日期打交道总是很容易把人搞昏掉。如此多的点、斜杠和格式。<strong>Datejs</strong>以令人耳目一新的方式提供或简单或复杂的日期函数。它可以处理如下格式的日期：“Next thursday”(下星期四), “+2 years”(两年后) 以及诸如2009.01.08, 12/6/2001的所有格式。</p>
<h4><a href="http://sylvester.jcoglan.com/" target="_blank">Sylvester</a></h4>
<p>此JavaScript脚本库可以轻松处理矢量和矩阵。有了它你就不用被一串串循环和大量数组搅得头昏脑胀了。此库包含模数化矢量和任意维度的矩阵的类，从而可以计算无限直线的模数和3D空间里的平面。</p>
<h4><a href="http://ejohn.org/projects/javascript-pretty-date/" target="_blank">Pretty Date </a></h4>
<p>一个聪明的JavaScript解决方案，让过去一个月内的日期以更加漂亮和用户友好的方式显示。它能让日期以距离现在多久的方式显示，如“3天以前”，“昨天”。</p>
<h4><a href="http://stevenlevithan.com/regex/xregexp/" target="_blank">XRegExp</a></h4>
<p>正则表达式可以在JavaScript里通过RegExp对象加以利用。 <strong>XRegExp</strong> 能使正则表达式变得更加强大，它提供一些在将来的浏览器才会实现的特性（据 ECMAScript 4 – ES4 的开发愿景）。使用该库，RegExp对象可以被缓存和再利用，还能为已经存在的RegExp对象添加修改器等等。</p>
<h4><a href="http://www.fliquidstudios.com/projects/javascript-url-library/" target="_blank">JavaScript URL Library</a></h4>
<p>一个用与方便处理URLs的JavaScript脚本库。如果需要，它可以控制到将URL内每一个部分当做字符串来处理。这一URL代码库刚出炉不久，但已能像刚才所提一样工作。</p>
<h2>6. 字体</h2>
<h4><a href="http://typeface.neocracy.org/" target="_blank">typeface.js</a></h4>
<p>一个用以在网页上使用任意字体的代码库。与流行的解决方案（如<a href="http://www.mikeindustries.com/blog/sifr/" target="_blank">sIFR</a> 和 <a href="http://facelift.mawhorter.net/" target="_blank">FLIR</a>）不同，<strong>typeface.js</strong> 并不需要Flash，是100%的JavaScript应用。要使用任意字体，只需上传其字体文件到一个 <a href="http://typeface.neocracy.org/fonts.html" target="_blank">基于网页的字体生成器</a>，然后下载渲染过的JavaScript文件，把它添加到你的网页中即可。</p>
<h4><a href="http://cufon.shoqolate.com/generate/" target="_blank">Cufón</a></h4>
<p>与typeface.js十分相似， <strong>Cufón</strong> 也是一个让你在网页中使用TrueType字体的代码库。同样，它也使用一个生成器来将字体文件转换成VML图像。只需在网页中插入generated .js文件，你即可像使用普通字体一样使用你指定的字体。</p>
<h2>7. 调试与记录</h2>
<h4><a href="http://www.gscottolson.com/blackbirdjs/" target="_blank">Blackbird</a></h4>
<p>在JavaScript开发过程中，经常会用到alert()函数来添加断点。<strong>Blackbird</strong> 提供一个风格化的控制台，用以记录、查看和过滤JavaScript中的消息，如此即可消除在每个alert()的停顿，并且更好地分析它们，从而加快开发进程。</p>
<h4><a href="http://www.nitobibug.com/" target="_blank">NitobiBug</a></h4>
<p>基于浏览器的，跨浏览器 <strong>JavaScript 对象记录和检测组件</strong>。通过在你的代码中插入规则（和JavaScript对象的用法类似），你可以轻易区别简单类型，如字符串、布尔值和数值，以及复杂元素，如错误信息和JavaScript对象。</p>
<h4><a href="http://getfirebug.com/lite.html" target="_blank">Firebug Lite</a></h4>
<p><strong>Firebug</strong>，大概是世界上最好的JavaScript调试工具，可惜只能在<a href="http://paranimage.com/category/apps/firefox/">Firefox</a>中使用。要在所有浏览器中拥有一个类似工具，向你的网页添加这个<strong>Firebug Lite</strong> .js文件吧，面对你的是你所熟悉的功能和界面。</p>
<h2>8. 其他</h2>
<h4><a href="http://code.google.com/p/swfobject/" target="_blank">swfobject</a></h4>
<p><strong>swfobject</strong> 是最流行的，扩展性最好的插入Flash影片的方式。此库符合Web标准，生成可以通过验证的标记，能够自动检测用户的Flash播放器版本，如果版本不匹配，它还允许你向用户显示代替内容。你可以看一看“<a href="http://www.alistapart.com/articles/flashembedcagematch/" target="_blank">为什么应该使用swfobject</a>”这篇文章，写得不错。</p>
<h4><a href="http://www.kryogenix.org/code/browser/sorttable/" target="_blank">sorttable</a> and <a href="http://www.danvk.org/wp/dragtable/" target="_blank">dragtable</a></h4>
<p>不管你喜不喜欢，表格仍然是展示数据的最佳方式。不过表格还可以更好用： <strong>sorttable</strong> 让表格数据可以排序，升序降序均可。你指向为添加class=”sortable” 属性。你还可以排除某些特定的栏，让他们不自动排序，以及指定升序或者降序哪一个为默认值。<strong>dragtable</strong> 使表格的行列变得可拖动。在网页中插入此库后，同样，给表格添加一个class=”dragtable”即可。如果需要两个功能都用，只需在网页中包含同时两个库，然后添加class=”sortable dragtable” 。</p>
<h4><a href="http://dillerdesign.com/experiment/DD_roundies/" target="_blank">DD_roundies</a> and <a href="http://www.dillerdesign.com/experiment/DD_belatedPNG/" target="_blank">DD_belatedPNG</a></h4>
<p><strong>DD_roundies</strong> 是一个极佳的<strong>不利用图片创建圆角</strong>的JavaScript解决方案。它处理的重点在IE，通过使用VML来解决问题。其他浏览器被忽略，因为他们支持CSS的 border-radius 属性。</p>
<p><strong>DD_belatedPNG</strong>为臭名昭著的IE6 PNG问题提供了一个可自定义的解决办法。不论PNG图像是用于“src”或是“background-image”中， <strong>DD_belatedPNG</strong> 都能把它解决掉。与其他解决方案不同， “background-position” 和 “background-repeat” 属性也能正常工作！</p>
<h4><a href="http://www.leigeber.com/2008/04/custom-javascript-dialog-boxes/" target="_blank">Custom JavaScript Dialog Boxes</a></h4>
<p>用于创建<strong>自定义对话框</strong>的轻量级（约 4.5 KB）代码库。四种对话框可用： alerts(出错), warnings(警告), prompts(提示), success(成功)。利用一个简单的函数，你可以自定义对话框的标题，内容和显示时间。</p>
<h4><a href="http://www.tommysmind.com/gamejs/" target="_blank">GameJS</a></h4>
<p><strong>GameJS </strong>是一个JavaScript版本的 <a href="http://www.xna.com/" target="_blank">Microsoft’s XNA 游戏框架</a>， 使用 “画布” 作为渲染机制。JavaScript不是编写游戏的最佳平台。不过如果是那些帧速要求较低的游戏，而你又是一个JavaScript开发者，何乐而不为？ 此库包含一些控制游戏元素、屏幕显示和键盘操作的方便好用的类。</p>
<h4><a href="http://www.openjs.com/scripts/events/keyboard_shortcuts/" target="_blank">Shortcuts.js</a></h4>
<p>自从Google Reader和Gmail之后，Web应用里的键盘快捷键变得越来越流行，因为他们大大提升了易用性。<strong>Shorcuts.js</strong>提供更为方便地处理键盘快捷键的函数。 使用该库，创建快捷键，然后在按下键盘的同时就运行函数成为更易实现的可能。</p>
<h4><a href="http://mapstraction.com/" target="_blank">Mapstraction</a></h4>
<p>几个不同的地图供应商都提供了各自不同的API。如果你想在供应商之间转换（比如说从Google Map转到MapQuest），则需要重写一些代码。<strong>Mapstraction</strong>就是用来帮你解决这个问题的。它提供一个通用 API ，帮你在大多数流行的地图供应商之间转换。只需更新一行代码，即可转换完毕。</p>
<h4><a href="http://amberjack.org/" target="_blank">Amberjack</a></h4>
<p>一个小巧的JavaScript脚本库，为你的网站添加上漂亮的导游信息。 一旦启用，一个模式化的内容框就能像到导游一样介绍您的站点，框内可以添加任意你想要的内容。导游内容的代码可以手工编写，也可以用<a href="http://amberjack.org/wizard/" target="_blank">线上工具</a>自动生成。当然，你可以通过编写css或者利用即刻可用的<a href="http://amberjack.org/skins/" target="_blank">主题</a>来使导游信息符合内容框的样式。</p>
<h4><a href="http://jsload.net/" target="_blank">JsLoad</a></h4>
<p>JavaScript脚本库的远程载入API。JsLoad这个简单的API能够让你从Google的服务器上导入大体积JavaScript文件。JsLoad能自动载入任何版本代码库的依赖文件。</p>
<p>英文原文: <a href="http://www.smashingmagazine.com/2009/03/02/40-stand-alone-javascript-libraries-for-specific-purposes/" target="_blank">40 Useful JavaScript Libraries | Smashing Magazine</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/40-lightweight-javascript-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
