<?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>CSSrainbow.cn &#187; Web Roundups</title>
	<atom:link href="http://cssrainbow.cn/category/articles/web-roundups/feed" rel="self" type="application/rss+xml" />
	<link>http://cssrainbow.cn</link>
	<description>Sharing what I know and learn about (X)HTML,CSS,JavaScript,MooTools,Dojo,jQuery,PHP,ASP,Java,Python and ∞.</description>
	<lastBuildDate>Sun, 05 Sep 2010 15:08:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS3 和 HTML5 兼容性测试</title>
		<link>http://cssrainbow.cn/articles/web-roundups/1254.html</link>
		<comments>http://cssrainbow.cn/articles/web-roundups/1254.html#comments</comments>
		<pubDate>Thu, 06 May 2010 02:59:13 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[CSS3 Test]]></category>
		<category><![CDATA[HTML5 Test]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=1254</guid>
		<description><![CDATA[你想知道你目前的WEB开发环境对CSS3和HTML5的支持情况和兼容性吗？如果想知道就跟我来，我会给你提供一些CSS3和HTML5的测试工具，来帮助你学习和应用这些新技术。]]></description>
			<content:encoded><![CDATA[<h2>引言</h2>
<p>你想知道你目前的WEB开发环境对CSS3和HTML5的支持情况和兼容性吗？如果想知道就跟我来，我会给你提供一些CSS3和HTML5的测试工具，来帮助你学习和应用这些新技术。</p>
<h3>关于HTML5 </h3>
<p>HTML5是未来主要的HTML版本,HTML5给我们提供了很多更语义化的结构化的标签。例如，和布局有关的标签就是非常有意义的功能，这种语义化的特性不仅提升了我们网页的质量和语义，并且大量减少了曾经代码中用于CSS必须调用的class和id属性。</p>
<p>更多的HTML5新功能，我们不在这里做具体的阐述。</p>
<blockquote>
<p>如果你想体验HTML5的新功能，请看下面的演示文档，几乎包括HTML5所有激动人<br />
心的新功能的简介和DEMO。</p>
<p><span id="more-1254"></span></p>
<p>中文版演示文档：<a href="http://directguo.com/html5/">http://directguo.com/html5/</a></p>
<p> 英文原版：<a href="http://apirocks.com/html5/html5.html">http://apirocks.com/html5/html5.html</a>（需翻墙）</p>
</blockquote>
<h3>关于CSS3</h3>
<p>CSS 技术我们已经并不陌生。而CSS3提供了非常多新途径去改善你的设计工作，且做了不少重要的变化。</p>
<p><strong>CSS 3 新功能</strong></p>
<p>圆角、多背景、@font-face 用户自定义字体、动画与渐变、渐变色、盒阴影、RGBa &#8211; 加入透明色、文字阴影等等<br />
CSS3 的出现，让代码更简洁、页面结构更合理，性能和效果得到兼顾。</p>
<h2>CSS3 和 HTML5 兼容性测试工具</h2>
<p>简单的说了那么多，我们可以肯定的 认为CSS3 和 HTML5 的组合会成为下一个Web标准，而且越来越多的浏览器开始支持它们的新属性，一向让我们头疼的IE 也要马上推出Internet Explorer 9 ，对CSS3 和 HTML5 也有一定的支持。  </p>
<p>&nbsp;</p>
<p>有兴趣的可以看一下 IE9 的 <a href="http://ie.microsoft.com/testdrive/Default.html"><strong>Test Drive </strong></a>。 </p>
<p>&nbsp;</p>
<p><a href="http://ie.microsoft.com/testdrive/Default.html"><img src="http://cssrainbow.cn/dw-content/demo18/ie9-test-drive.png" width="575" height="340"  alt="ie9-test-drive"/></a></p>
<h3>CSS3 Selectors Test</h3>
<p>你想知道您的浏览器对CSS3 Selectors的支持情况吗，只要我们在相应的浏览器中运行此测试套件页面，将自动运行一个小测试，能马上知道您的浏览器 是否 支持 与之相配的CSS Selectors。测试完毕以后，您可以点击每个CSS Selectors来查看结果，其中包括一个小例子，并为每个测试做出解释。因为它在技术上是不可以 与某些用户 进行 交互 模拟测试某个或某几个CSS Selectors ，目前只能批量测试 CSS Selectors 。所以这个测试套件不包括以下的选择器测试：:hover, :active, :focus and :selection 。
</p>
<p>
  <a href="http://tools.css3.info/selectors-test/test.html"> <img src="http://cssrainbow.cn/dw-content/demo18/css3-slecetore.png" width="568" height="668"  alt="css3-slecetore"/> </a></p>
<p>&nbsp;</p>
<p>还等什么!  点击  <a href="http://tools.css3.info/selectors-test/test.html">     <strong>The CSS3 Selectors test </strong></a> 页面进行测试。</p>
<p>&nbsp;</p>
<h3>HTML5 Test</h3>
<p>你想知道您的浏览器对HTML5的支持情况吗，我们用最直观的测试数据告诉您！</p>
<p><a href="http://html5test.com/"><img src="http://cssrainbow.cn/dw-content/demo18/html5-test.png" width="571" height="630"  alt="html5-test"/></a></p>
<p>&nbsp;</p>
<p>还等什么!  点击  <a href="http://html5test.com/">     <strong>The HTML5 test</strong></a> 页面进行测试。</p>
<p>&nbsp;</p>
<h3>CSS3 和 HTML5 兼容速查表</h3>
<p><a href="http://www.findmebyip.com/litmus#target-selector"><strong>FindMeByIP.com </strong></a>为我们提供了CSS3 和 HTML5 兼容速查表，已经在所有的A级浏览器中测试过，结果非常有趣。
</p>
</p>
<p><a href="http://www.findmebyip.com/litmus#target-selector"><img src="http://cssrainbow.cn/dw-content/demo18/css3-and-html5-test.png" width="574" height="310"  alt="css3-and-html5-test"/></a></p>
<p>
总之，这些丰富的测试工具，为我们的CSS3 + HTML5 的开发和应用带来了方便，不过这些新东西暂时还不能大量的应用到我们的客户项目中，还得需要很长的时间进行过渡，所以 我们要三思而后行，以免带来麻烦。</p>
<p>肯定的是，它们是未来WEB标准的主角，早点学习是没错的。我们可以把这些新技术应用到我们的博客或者是Web设计社区中，提前体验和实战。</p>
<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2010/05/17 -- <a href="http://cssrainbow.cn/tutorials/html5-tutorials/1287.html" title="HTML5入门 之 新标签的解析 篇">HTML5入门 之 新标签的解析 篇</a> (3)</li><li>2010/05/13 -- <a href="http://cssrainbow.cn/tutorials/html5-tutorials/1284.html" title="HTML5入门 之 样板和兼容IE浏览器篇">HTML5入门 之 样板和兼容IE浏览器篇</a> (6)</li><li>2010/05/11 -- <a href="http://cssrainbow.cn/tutorials/html5-tutorials/1278.html" title="HTML5入门之标签篇《下》 ">HTML5入门之标签篇《下》 </a> (0)</li><li>2010/05/11 -- <a href="http://cssrainbow.cn/tutorials/html5-tutorials/1257.html" title="HTML5入门之标签篇《上》">HTML5入门之标签篇《上》</a> (0)</li><li>2010/04/21 -- <a href="http://cssrainbow.cn/code-snippets/html5-code-snippets/1244.html" title="HTML5 Canvas 基础知识与入门">HTML5 Canvas 基础知识与入门</a> (4)</li><li>2010/03/22 -- <a href="http://cssrainbow.cn/code-snippets/javascript-code-snippets/1187.html" title="简单的斑马纹表格">简单的斑马纹表格</a> (2)</li><li>2010/03/04 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/1137.html" title="Web 设计中的 5 个最具争议性的话题">Web 设计中的 5 个最具争议性的话题</a> (0)</li><li>2010/01/24 -- <a href="http://cssrainbow.cn/articles/web-roundups/932.html" title="在Webkit浏览器中，使用CSS3替代7个JavaScript效果">在Webkit浏览器中，使用CSS3替代7个JavaScript效果</a> (0)</li><li>2010/01/18 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/901.html" title="用CSS改变选择文本的背景颜色">用CSS改变选择文本的背景颜色</a> (0)</li><li>2010/01/15 -- <a href="http://cssrainbow.cn/demos/892.html" title="让所有的浏览器都支持 HTML5 placeholder 属性，基于MooTools">让所有的浏览器都支持 HTML5 placeholder 属性，基于MooTools</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/articles/web-roundups/1254.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQuery vs MooTools 专题系列</title>
		<link>http://cssrainbow.cn/articles/web-roundups/1218.html</link>
		<comments>http://cssrainbow.cn/articles/web-roundups/1218.html#comments</comments>
		<pubDate>Fri, 26 Mar 2010 03:23:23 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery vs MooTools]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=1218</guid>
		<description><![CDATA[我这里整理《jQuery vs MooTools 专题系列》的文章，目的不是PK,只是为了推动这两个非常值得学习的库（Libraries），并合理的和高效的应用到我们的工作中。国内学习MooTools 的人很少，与jQuery相比而言。我还是鼓励大家学习一下MooTools 。所以我才会策划这个《jQuery vs MooTools 专题系列》，以来解惑，增强学习MooTools 的信心。]]></description>
			<content:encoded><![CDATA[<p>学习 MooTools 和 jQuery  也有一段时间了，以前为了选择一个符合自己的JavaScript 库 而查看大量的资料，并细心的观察这几个比较流行的库（jQuery, MooTools, Prototype, Dojo, YUI），到底哪个适合我 &#8230;&#8230; 不用说，你也许猜得到了我选择的是以MooTools 为主jQuery 为辅的学习方案。好东西虽然不可兼得，但可以互补。从而提高我的JavaScript开发水平。</p>
<p>我这里整理《<strong>jQuery vs MooTools 专题系列</strong>》的文章，目的不是PK,只是为了推动这两个非常值得学习的库（Libraries），并合理的和高效的应用到我们的工作中。</p>
<p>国内学习MooTools 的人很少，与jQuery相比而言。我还是鼓励大家学习一下MooTools 。所以我才会策划这个《<strong>jQuery vs MooTools 专题系列</strong>》，以来解惑，增强学习MooTools 的信心。</p>
<p><span id="more-1218"></span></p>
<p>&nbsp;</p>
<p><img src="http://cssrainbow.cn/jquery-vs-mootools/jQuery-vs-MooTools.jpg" width="600" height="265" alt="jQuery vs MooTools Thematic Series"/></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<dl>
<dt><a href="http://cssrainbow.cn/jquery-vs-mootools/jquery-1-4-mootools-1-2-compared.html" class="button">jQuery 1.4, MooTools 1.2 比较 </a>（英文版）</dt>
<dd>&nbsp;</p>
</dd>
<dt><a href="http://cssrainbow.cn/jquery-vs-mootools/index_cn-simplified.html" class="button">jQuery vs MooTools</a> (多国语言版)</dt>
<dd></dd>
<dd>&nbsp;</dd>
<dt> <a  class="button" href="http://cssrainbow.cn/jquery-vs-mootools/jquery-mootools-which-is-the-most-popular-and-well-represented-framework-and-what-really-makes-one-framework-different-from-another.html">jQuery和MooTools的真正区别</a>（中英版）</dt>
<dd>&nbsp;</dd>
</dl>
<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2010/06/30 -- <a href="http://cssrainbow.cn/tutorials/jquery/1347.html" title="盒子（Box）中间的链接（Links）,基于MooTools or jQuery ">盒子（Box）中间的链接（Links）,基于MooTools or jQuery </a> (5)</li><li>2010/06/29 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1342.html" title="使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类">使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类</a> (0)</li><li>2010/06/27 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1333.html" title="在我喜欢的JavaScript Frameworks中使用匿名方法">在我喜欢的JavaScript Frameworks中使用匿名方法</a> (4)</li><li>2010/06/24 -- <a href="http://cssrainbow.cn/tutorials/jquery/1331.html" title="打破重复的动画效果,基于CSS,MooTools or jQuery">打破重复的动画效果,基于CSS,MooTools or jQuery</a> (3)</li><li>2010/03/30 -- <a href="http://cssrainbow.cn/tutorials/jquery/1225.html" title="关于‘TOP’置顶链接的那些事儿">关于‘TOP’置顶链接的那些事儿</a> (0)</li><li>2010/03/18 -- <a href="http://cssrainbow.cn/tutorials/mootools/1183.html" title="jQuery 1.4, MooTools 1.2 比较">jQuery 1.4, MooTools 1.2 比较</a> (0)</li><li>2010/03/15 -- <a href="http://cssrainbow.cn/tutorials/mootools/1168.html" title="图片延迟加载，基于MooTools or jQuery">图片延迟加载，基于MooTools or jQuery</a> (1)</li><li>2010/03/12 -- <a href="http://cssrainbow.cn/articles/web-roundups/1159.html" title="20个最佳的Lightbox效果收藏，基于MooTools or jQuery">20个最佳的Lightbox效果收藏，基于MooTools or jQuery</a> (0)</li><li>2010/03/08 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1143.html" title="在MooTools中实现类似于jQuery事件一样的语法">在MooTools中实现类似于jQuery事件一样的语法</a> (0)</li><li>2010/03/05 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1141.html" title="删除残破的图片（Broken Images），基于 MooTools or jQuery">删除残破的图片（Broken Images），基于 MooTools or jQuery</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/articles/web-roundups/1218.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>jQuery 1.4, MooTools 1.2 比较</title>
		<link>http://cssrainbow.cn/tutorials/mootools/1183.html</link>
		<comments>http://cssrainbow.cn/tutorials/mootools/1183.html#comments</comments>
		<pubDate>Thu, 18 Mar 2010 07:48:36 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery1.4]]></category>
		<category><![CDATA[MooTools1.2]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=1183</guid>
		<description><![CDATA[2010年1月14日，我在Nettuts网站上看到了《 jQuery 1.4 Released: The 15 New Features you Must Know
》的文章，16号的时候就有中文版的译文了，《[译]jQuery 1.4 发布：15个新特性实例精讲 》，我也感受了一下 jQuery 1.4给我们带来的变化。有意思的是我所看到的jQuery1.4的新特性，在MooTools1.2+的版本里早有实现。
我在这里不想jQuery VS MooTools ，也不想为谁公正。 很显然我比较喜欢MooTools ,因为它更适合我和我的工作，我也不想重复学习一些东西。我所看到的对jQuery的偏见，其实是大家有目共睹的，jQuery也是明显的（就是jQuery也采用了MooTools的一些特性等等的做法）。然而，当你阅读到这儿的时候我也不是试图去说服你转入到MooTools下当门徒，说jQuery是劣等的，从而抛弃jQuery 。就好像你选择浏览器是IE,操作系统是Windows，汽车是福特，喝的百事可乐。小平爷爷说的好“不管黑猫白猫，抓住老鼠就是好猫”。我只是在这里分享我用MooTools开发的一些想法（其实我有好几个项目就是采用的jQuery开发的）。

无论如何，为了方便自己，我使用jsfiddle 或 mooshell 工具 – 在线可以帮助您编写 html, css 和 javascript，并且可以测试实例。我选择的jsfiddle在线工具来偷懒代码片段的，可以节省一些时间，快速测试，也方便我们快速了解jQuery1.4中令人敬畏的新特性，以及MooTools中更多令人敬畏的东西。

 原文来自：jQuery 1.4, MooTools 1.2 Compared
作者与博客：Ryan Florence Blog 

Enjoy!
1. Passing Attributes During Element Construction / 传参给 jQuery(…)
jQuery 1.4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
jQuery&#40;'&#60;div/&#62;', &#123;  
&#160;
    id: 'foo', [...]]]></description>
			<content:encoded><![CDATA[<p>2010年1月14日，我在Nettuts网站上看到了《 <a href="http://net.tutsplus.com/tutorials/javascript-ajax/jquery-1-4-released-the-15-new-features-you-must-know/">jQuery 1.4 Released: The 15 New Features you Must Know</a><br />
》的文章，16号的时候就有中文版的译文了，《<a href="http://bbs.blueidea.com/thread-2966655-1-1.html">[译]jQuery 1.4 发布：15个新特性实例精讲</a> 》，我也感受了一下 jQuery 1.4给我们带来的变化。有意思的是我所看到的jQuery1.4的新特性，在MooTools1.2+的版本里早有实现。</p>
<p>我在这里不想jQuery VS MooTools ，也不想为谁公正。 很显然我比较喜欢MooTools ,因为它更适合我和我的工作，我也不想重复学习一些东西。我所看到的对jQuery的偏见，其实是大家有目共睹的，jQuery也是明显的（就是jQuery也采用了MooTools的一些特性等等的做法）。然而，当你阅读到这儿的时候我也不是试图去说服你转入到MooTools下当门徒，说jQuery是劣等的，从而抛弃jQuery 。就好像你选择浏览器是IE,操作系统是Windows，汽车是福特，喝的百事可乐。小平爷爷说的好“不管黑猫白猫，抓住老鼠就是好猫”。我只是在这里分享我用MooTools开发的一些想法（其实我有好几个项目就是采用的jQuery开发的）。</p>
<p><span id="more-1183"></span></p>
<p>无论如何，为了方便自己，我使用<a href="http://jsfiddle.net/">jsfiddle</a> 或 <a href="http://mooshell.net/">mooshell</a> 工具 – 在线可以帮助您编写 html, css 和 javascript，并且可以测试实例。我选择的<a href="http://jsfiddle.net/">jsfiddle</a>在线工具来偷懒代码片段的，可以节省一些时间，快速测试，也方便我们快速了解jQuery1.4中令人敬畏的新特性，以及MooTools中更多令人敬畏的东西。</p>
<blockquote>
<p> 原文来自：<a href="http://ryanflorence.com/jquery-1-4-mootools-1-2-compared/">jQuery 1.4, MooTools 1.2 Compared</a></p>
<p>作者与博客：<a title="Go to Ryan Florence Blog." href="http://ryanflorence.com">Ryan Florence Blog</a> </p>
</blockquote>
<p>Enjoy!</p>
<h2>1. Passing Attributes During Element Construction / <strong>传参给 jQuery(…)</strong></h2>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div/&gt;'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
    id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'foo'</span><span style="color: #339933;">,</span>  
&nbsp;
    css<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
        fontWeight<span style="color: #339933;">:</span> <span style="color: #CC0000;">700</span><span style="color: #339933;">,</span>  
&nbsp;
        color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'green'</span>  
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>  
&nbsp;
    click<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  
&nbsp;
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Foo has been clicked!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
&nbsp;
    <span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>MooTools (all versions)</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">new</span> Element<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span> 
&nbsp;
  id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'foo'</span><span style="color: #339933;">,</span> 
&nbsp;
  styles<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #3366CC;">'font-weight'</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">700</span><span style="color: #339933;">,</span> 
&nbsp;
    color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'green'</span> 
&nbsp;
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
&nbsp;
  events<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #3366CC;">'click'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
      <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Foo has been clicked!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
    <span style="color: #009900;">&#125;</span> 
&nbsp;
  <span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>jQuery is looking a lot more moo-ish here by passing an object in rather than chaining everything.</p>
<h3>jQuery Shell</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/97xAn/embedded/js,html,result" style="width: 100%;height: 300px"></iframe></p>
<h3>MooTools Shell</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/97xAn/2/embedded/js,html,result" style="width: 100%;height: 300px"></iframe></p>
<h2>2. Everything Until! / 直到遇见你&#8230;</h2>
<h3>HTML</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fruit&quot;</span>&gt;</span>  
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>Apple<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>  
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>Banana<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>  
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>Grape<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>  
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>Strawberry<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>  
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>Pear<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>  
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>Peach<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>  
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></td></tr></table></div>

<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul#fruit li:contains(Apple)'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nextUntil</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':contains(Pear)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Selects Banana, Grape, Strawberry</span></pre></td></tr></table></div>

<h3>MooTools 1.2 + <a href="http://ryanflorence.com/shell/Element.GetUntil.js">Element.GetUntil </a>Plugin</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul li:contains(Apple)'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">getAllNextUntil</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':contains(Pear)); 
&nbsp;
// more mooish 
&nbsp;
$('</span>fruit<span style="color: #3366CC;">').getElement('</span>li<span style="color: #339933;">:</span>contains<span style="color: #009900;">&#40;</span>Apple<span style="color: #009900;">&#41;</span><span style="color: #3366CC;">').getAllNextUntil('</span><span style="color: #339933;">:</span>contains<span style="color: #009900;">&#40;</span>Pear<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>I thought these new until methods were interesting so I extended MooTools with similar functionality. See my <a href="http://ryanflorence.com/jquery-1-4s-new-until-methods-caught-my-eye-introducing-element-getuntil/">post</a> about Element.GetUntil.</p>
<h3>jQuery</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/Y9S8M/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h3>MooTools</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/Y9S8M/1/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h2>3. Binding Multiple Events / 绑定多个事件处理器</h2>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#foo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>  
&nbsp;
    click<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
        <span style="color: #006600; font-style: italic;">// do something   </span>
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>  
&nbsp;
    mouseover<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
        <span style="color: #006600; font-style: italic;">// do something   </span>
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>  
&nbsp;
    mouseout<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
        <span style="color: #006600; font-style: italic;">// do something   </span>
&nbsp;
    <span style="color: #009900;">&#125;</span>  
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>MooTools (all versions)</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
  click<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #006600; font-style: italic;">// do something </span>
&nbsp;
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
&nbsp;
  mouseenter<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #006600; font-style: italic;">// do stuff a bit better than mouseover </span>
&nbsp;
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
&nbsp;
  mouseleave<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #006600; font-style: italic;">// do stuff a bit better than mouseout </span>
&nbsp;
  <span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>jQuery 1.4 again is looking a lot more like mootools, very nice<br />
because now you can store a handful of events in an object and toss<br />
them around.</p>
<p><strong>Note</strong>: “MooTools features mouseenter and mouseleave<br />
because mouseover/mouseout sometimes just don’t not work as expected.<br />
Mouseenter only fires once you enter the element and does not fire<br />
again if your mouse crosses over children of the element.” <a href="http://demos.mootools.net/Mouseenter">moootools.net</a></p>
<h3>jQuery</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/yBgCD/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h3>MooTools</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/yBgCD/1/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h2>4. Per Property Easing / 依属性指定缓动效果</h2>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#foo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>  
&nbsp;
    left<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>  
&nbsp;
    top<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">500</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'easeOutBounce'</span><span style="color: #009900;">&#93;</span>  
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>MooTools 1.2 + Fx.Transmorph Plugin</h3>
<p><a href="http://mootools.net/forge/p/fx_transmorph">Fx.Transmorph</a> is the same thing, different syntax:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">transmorph</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>height<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span> <span style="color: #3366CC;">'bounce:out'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>MooTools 1.2 + Fx.Flux Plugin</h3>
<p>Fx.Flux is unique in that it allows you to define ANY of the<br />
Fx.Morph instructions rather than just the transition. Yes, you can<br />
change the duration, transition, unit, etc.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">flux</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">370</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
        duration<span style="color: #339933;">:</span> <span style="color: #CC0000;">1500</span><span style="color: #339933;">,</span> 
&nbsp;
        transition<span style="color: #339933;">:</span><span style="color: #3366CC;">'bounce:out'</span> 
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> 
&nbsp;
    <span style="color: #3366CC;">'left'</span><span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">370</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
        duration<span style="color: #339933;">:</span> <span style="color: #CC0000;">3000</span><span style="color: #339933;">,</span> 
&nbsp;
        transition<span style="color: #339933;">:</span><span style="color: #3366CC;">'cubic:out'</span> 
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>Just Mootools</h3>
<p>You’d have to set up multiple Tween / Morph instances. However, this<br />
affords you control over every aspect of the tween (including events),<br />
not just the easing.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> foo <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> fooFx1 <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Fx.<span style="color: #660066;">Tween</span><span style="color: #009900;">&#40;</span>foo<span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span> 
&nbsp;
  transition<span style="color: #339933;">:</span> <span style="color: #3366CC;">'elastic:out'</span><span style="color: #339933;">,</span> 
&nbsp;
  duration<span style="color: #339933;">:</span> <span style="color: #CC0000;">2000</span><span style="color: #339933;">,</span> 
&nbsp;
  onStart<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #006600; font-style: italic;">// do something fun </span>
&nbsp;
  <span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> fooFx2 <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Fx.<span style="color: #660066;">Morph</span><span style="color: #009900;">&#40;</span>foo<span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span> 
&nbsp;
  transition<span style="color: #339933;">:</span> <span style="color: #3366CC;">'sine:in:out'</span><span style="color: #339933;">,</span> 
&nbsp;
  duration<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span> 
&nbsp;
  onComplete<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #006600; font-style: italic;">// do something important </span>
&nbsp;
  <span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
fooFx1.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
fooFx2.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span><span style="color: #CC0000;">500</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'border'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'10'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>So yeah, a lot of code. I think jQuery implemented something cool<br />
here and I certainly hope to see a version of Fx.Flux in the mootools<br />
forge. When we all start getting crazy with canvas and svg we’ll want<br />
leaner syntax for animation than the mootools code block above this,<br />
and more control than just the easing in jQuery. Oh, Fx.Flux, yes,<br />
that’s what I’m thinking of.</p>
<h3>jQuery</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/8sgrw/3/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h3>MooTools Fx.Flux</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/8sgrw/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h2>5. Live Events / 更新的 Live 事件！</h2>
<p>That’s just another name for event delegation. I’ve got an <a href="http://ryanflorence.com/event-delegation-with-mootools-quit-selecting-all-those-elements/">entire post</a><br />
on event delegation with mootools. Basic concept, instead of adding the<br />
same events (or as jquery calls it, binding events) on multiple<br />
elements, just add the event to a single parent element and delegate,<br />
or relay the event to the children. Then any dynamically added elements<br />
(inserted via ajax, or otherwise) will have the event.</p>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul#foo li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  
&nbsp;
    <span style="color: #006600; font-style: italic;">// do something with this   </span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>MooTools 1.2 + Element.Delegates</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click:relay(li)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Some <em>very</em> big differences in the two approaches here.</p>
<ol>
<li>
<p>jQuery listens to the entire document for clicks. That feels a<br />
little, erm, less-awesome than it should be. That means every single<br />
click goes ahead and finds out if it was an <code>li</code> inside of <code>foo</code> that was clicked.</p>
</li>
<li>
<p>MooTools only listens to the element you tell it to.</p>
</li>
</ol>
<p>MooTools is also more clear about what’s going on. You are adding<br />
the event to an element that will relay the event to it’s matched<br />
children. The identical code in MooTools to the jquery example would be:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click:relay(ul#foo &gt; li)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>But don’t ever do that if you don’t have to. Srsly d00d. Don’t get<br />
me wrong, event delegation is one of my favorite toys, so I’m very<br />
excited it’s part of jQuery now, just a bit disappointed I have to<br />
listen to the whole document, he’s going to be a busy man.</p>
<p><strong>Note</strong>: Jquery kicks MooTools in the pants when it comes to delegating <code>focusin</code> and <code>focusout</code>.  The current implementation of MooTools event delegation doesn’t support the <code>focus</code> and <code>blur</code> methods, but MooTools 2.0 will.</p>
<h3>jQuery</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/cZBbh/3/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h3>MooTools</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/cZBbh/2/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h2>6. Controlling a Functions Context / 控制函数上下文</h2>
<p>In other words, what will <code>this</code> be inside a function?  Given this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> app <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
    config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
        clickMessage<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Hi!'</span>  
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>  
&nbsp;
    clickHandler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">clickMessage</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
&nbsp;
    <span style="color: #009900;">&#125;</span>  
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// jQuery </span>
&nbsp;
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> app.<span style="color: #660066;">clickHandler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// won't work, `this` is the clicked `a` </span>
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// Mootools </span>
&nbsp;
$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> app.<span style="color: #660066;">clickHandler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// same thing</span></pre></td></tr></table></div>

<p>When an anchor tag is clicked, we want to alert <code>this.config.clickMessage</code>, or ‘Hi!’.  Here are the solutions:</p>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span> 
&nbsp;
  <span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> 
&nbsp;
  jQuery.<span style="color: #660066;">proxy</span><span style="color: #009900;">&#40;</span>app<span style="color: #339933;">,</span> <span style="color: #3366CC;">'clickHandler'</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>MooTools (all versions)</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span> 
&nbsp;
  <span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> 
&nbsp;
  app.<span style="color: #660066;">clickHandler</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span>app<span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This should have been in jQuery a long time ago. I have a hard time<br />
imagining writing a well structured javascript app without binding, or<br />
proxy-ing (?) as shown in this example. I think the MooTools syntax is<br />
easier as you don’t have to split up the object, just bind it. Things<br />
get a little confusing too with jQuery when you’ve got nested methods<br />
in an object:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> app <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
    config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
        clickMessage<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Hi!'</span>  
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
&nbsp;
    clickHandler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">clickMessage</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
&nbsp;
    nested<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
        keyupHandler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
&nbsp;
            <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">clickMessage</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
&nbsp;
        <span style="color: #009900;">&#125;</span> 
&nbsp;
    <span style="color: #009900;">&#125;</span>  
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> 
&nbsp;
&nbsp;
&nbsp;
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
  <span style="color: #3366CC;">'click'</span><span style="color: #339933;">:</span> jQuery.<span style="color: #660066;">proxy</span><span style="color: #009900;">&#40;</span>app<span style="color: #339933;">,</span> <span style="color: #3366CC;">'clickHandler'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 
&nbsp;
  <span style="color: #3366CC;">'keyup'</span><span style="color: #339933;">:</span> jQuery.<span style="color: #660066;">proxy</span><span style="color: #009900;">&#40;</span>app.<span style="color: #660066;">nested</span>.<span style="color: #660066;">keyupHandler</span><span style="color: #339933;">,</span> app<span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// backwards? </span>
&nbsp;
<span style="color: #009900;">&#125;</span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// MooTools </span>
&nbsp;
$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
  <span style="color: #3366CC;">'click'</span><span style="color: #339933;">:</span> app.<span style="color: #660066;">clickHandler</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span>app<span style="color: #009900;">&#41;</span> 
&nbsp;
  <span style="color: #3366CC;">'keyup'</span><span style="color: #339933;">:</span> app.<span style="color: #660066;">nested</span>.<span style="color: #660066;">keyupHandler</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span>app<span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// coherent </span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Seems really strange to swap the arguments around to accommodate a<br />
nested method. MooTools is much clearer here, just pass in the function<br />
as you would normally, then bind whatever you want.</p>
<h3>jQuery</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/YH9C7/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h3>MooTools</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/YH9C7/1/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h2>7. Delay an animation queue / 动画队列延迟</h2>
<h3>jQuery</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#foo'</span><span style="color: #009900;">&#41;</span> 
&nbsp;
  .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'width'</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">250</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
  .<span style="color: #660066;">delay</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span> 
&nbsp;
  .<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
  .<span style="color: #660066;">delay</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span> 
&nbsp;
  .<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;</span>em<span style="color: #339933;">&gt;&lt;/</span>em<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<h3><em>MooTools 1.2 with Chain.Wait</em></h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foo'</span><span style="color: #009900;">&#41;</span> 
&nbsp;
   .<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'width'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">250</span><span style="color: #009900;">&#41;</span> 
&nbsp;
   .<span style="color: #660066;">pauseFx</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span> 
&nbsp;
   .<span style="color: #660066;">fade</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'out'</span><span style="color: #009900;">&#41;</span> 
&nbsp;
   .<span style="color: #660066;">pauseFx</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span> 
&nbsp;
   .<span style="color: #660066;">fade</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'in'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>jQuery</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/yWS6d/1/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h3>MooTools</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/yWS6d/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h2>8. Check if an element has something / 检测元素是否含有特定内容</h2>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">has</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>MooTools 1.2</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasChild</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h2>9. Unwrap an element / <strong>给元素剥皮！</strong></h2>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'p'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unwrap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>MooTools 1.2</h3>
<p>Nuthin’ baked in, but if you find yourself needing to unwrap elements often you could extend <code>Element</code> to handle it.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// include this with your other classes and javascript </span>
&nbsp;
Element.<span style="color: #660066;">implement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    unwrap<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> parent <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getParent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
        parent.<span style="color: #660066;">getChildren</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">inject</span><span style="color: #009900;">&#40;</span>parent<span style="color: #339933;">,</span><span style="color: #3366CC;">'before'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
        parent.<span style="color: #660066;">dispose</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> 
&nbsp;
    <span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// now you've got unwrap </span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'p'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unwrap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Edit</strong>: Thanks to Chee Aun in the comments, he pointed out that I missed text nodes in my solution.  Indeed.  Check out his <a href="http://gist.github.com/213078">gist</a> for a better solution.  You would instead target an element to remove rather than a child to oust it’s parent.</p>
<h3>jQuery</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/tsc95/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h3>MooTools</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/tsc95/1/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h2>10. Remove elements without deleting data / 移除元素，而不删除数据</h2>
<h3>jQuery</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">foo.<span style="color: #660066;">detach</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Remove it from the DOM   </span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// ... do stuff   </span>
&nbsp;
&nbsp;
&nbsp;
foo.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Add it back to the DOM</span></pre></td></tr></table></div>

<h3>MooTools (all versions)</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">foo.<span style="color: #660066;">dispose</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Remove from the DOM </span>
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// ... do stuff </span>
&nbsp;
&nbsp;
foo.<span style="color: #660066;">inject</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Add it back to the DOM</span></pre></td></tr></table></div>

<p>Again, this was one of those things that surprised me that jquery<br />
didn’t have, especially since jQuery’s focus is the DOM. It’s<br />
especially helpful when you’ve got some heavy duty dom manipulation<br />
going on: pull everything out, manipulate, the browser doesn’t try to<br />
redraw, inject it back into the DOM. Only redraws once.</p>
<h2>11. Index enhancements / <strong>index(…) 的功能增强</strong></h2>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  
&nbsp;
  <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">index</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
  <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">index</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li.other'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>MooTools</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> els <span style="color: #339933;">=</span> $$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
els.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>els.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li.other'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// more common </span>
&nbsp;
$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> index<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
  element.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>index<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This is clearly more valuable to the jquery coding style.  I’ve never used <code>indexOf</code> in mootools, I’m usually in an <code>each</code> loop.</p>
<h3>jQuery</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/fsfEk/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h3>MooTools</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/fsfEk/1/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h2>12. DOM Manipulation accepts functions as arguments / DOM 操纵可接收回调函数</h2>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">'Index of this list item: '</span> <span style="color: #339933;">+</span> i<span style="color: #339933;">;</span>  
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This is actually quite interesting, it’s geared a lot more toward<br />
the coding style of jQuery than mootools, but after talking to Thomas<br />
Aylott about it, we (read: he), came up with this …</p>
<h3>MooTools 1.2 with Elements.setEach Plugin</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setEach</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
  <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">'Index of this list item: '</span> <span style="color: #339933;">+</span> i<span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// actually, there's a ton you can do with setEach </span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> replaceFooWithBar<span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span> String<span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\bfoo\b/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'bar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// just like jQuery </span>
&nbsp;
$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setEach</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>currentHref<span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span> currentHref <span style="color: #339933;">+</span> <span style="color: #3366CC;">'?foo=bar'</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// or pass in an array of stuff and it'll do it all</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// notice how `html` is accessible in the function </span>
&nbsp;
$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setEach</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span> 
&nbsp;
    <span style="color: #3366CC;">&quot;New foo HTML!&quot;</span><span style="color: #339933;">,</span> 
&nbsp;
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>html<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> html <span style="color: #339933;">+</span> <span style="color: #3366CC;">' appended moar foo!'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
&nbsp;
    replaceFooWithBar<span style="color: #339933;">,</span> 
&nbsp;
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>html<span style="color: #339933;">,</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> html <span style="color: #339933;">+</span> <span style="color: #3366CC;">' Index is '</span> <span style="color: #339933;">+</span> i<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// or set multiple things, in this case, multiple styles </span>
&nbsp;
$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setEachStyle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #3366CC;">'color'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>currentColor<span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
        i <span style="color: #339933;">=</span> i.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
&nbsp;
    <span style="color: #3366CC;">'background-color'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>currentColor<span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
        i <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">15</span> <span style="color: #339933;">-</span> i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
    <span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Radical.  Hats off to Thomas Aylott for this 30 minute script.</p>
<h3>jQuery</h3>
<p><iframe src="http://jsfiddle.net/rpflorence/jDcGa/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h3>MooTools</h3>
<p><iframe src="http://mootools.net/shell/Knfjs/embedded/js,html,result" style="width: 100%;height: 300px;"></iframe></p>
<h2>13. Determine the Type of Object (sort of) / 判定对象类型</h2>
<h3>jQuery 1.4</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">isEmptyObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// true   </span>
&nbsp;
jQuery.<span style="color: #660066;">isEmptyObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>foo<span style="color: #339933;">:</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// false   </span>
&nbsp;
&nbsp;
&nbsp;
jQuery.<span style="color: #660066;">isPlainObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// true   </span>
&nbsp;
jQuery.<span style="color: #660066;">isPlainObject</span><span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// false    </span>
&nbsp;
jQuery.<span style="color: #660066;">isPlainObject</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// false</span></pre></td></tr></table></div>

<p>I’m not entirely sure how helpful this is. Seems like if an object<br />
is empty when you iterate over it, nothing happens, is there a reason<br />
to check first? Also, why do I care if it’s <code>{}</code> versus <code>new Object()</code>.  I’m genuinely curious, not bashing.</p>
<h3>MooTools 1.2</h3>
<p>Straight from <a href="http://keetology.com/blog/2010/01/21/up-the-moo-herd-v-evident-utensil">Keetology: Up the Moo Herd V: Evident Utensil</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// JavaScript's typeof operator..  </span>
&nbsp;
<span style="color: #000066; font-weight: bold;">typeof</span> <span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #339933;">;</span>       <span style="color: #006600; font-style: italic;">// 'string'  </span>
&nbsp;
<span style="color: #000066; font-weight: bold;">typeof</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>         <span style="color: #006600; font-style: italic;">// 'number'  </span>
&nbsp;
<span style="color: #000066; font-weight: bold;">typeof</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>        <span style="color: #006600; font-style: italic;">// 'object'  </span>
&nbsp;
<span style="color: #000066; font-weight: bold;">typeof</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>        <span style="color: #006600; font-style: italic;">// 'object'.. wait, what?  </span>
&nbsp;
<span style="color: #000066; font-weight: bold;">typeof</span> <span style="color: #009966; font-style: italic;">/m/</span><span style="color: #339933;">;</span>       <span style="color: #006600; font-style: italic;">// 'object' in some, 'function' in others..  </span>
&nbsp;
<span style="color: #000066; font-weight: bold;">typeof</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 'object'.. you're not</span></pre></td></tr></table></div>

<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2009/09/24 -- <a href="http://cssrainbow.cn/tutorials/jquery/742.html" title="模仿Flickr的下拉导航条，基于MooTools &#038; jQuery实现的">模仿Flickr的下拉导航条，基于MooTools &#038; jQuery实现的</a> (0)</li><li>2009/09/24 -- <a href="http://cssrainbow.cn/tutorials/jquery/740.html" title="让链接(link)充满活力,基于MooTools &#038; jQuery实现的">让链接(link)充满活力,基于MooTools &#038; jQuery实现的</a> (0)</li><li>2009/07/31 -- <a href="http://cssrainbow.cn/tutorials/jquery/561.html" title="三大“Sexy”特效库,基于mootools &#038; jQuery">三大“Sexy”特效库,基于mootools &#038; jQuery</a> (0)</li><li>2010/06/30 -- <a href="http://cssrainbow.cn/tutorials/jquery/1347.html" title="盒子（Box）中间的链接（Links）,基于MooTools or jQuery ">盒子（Box）中间的链接（Links）,基于MooTools or jQuery </a> (5)</li><li>2010/06/29 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1342.html" title="使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类">使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类</a> (0)</li><li>2010/06/27 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1333.html" title="在我喜欢的JavaScript Frameworks中使用匿名方法">在我喜欢的JavaScript Frameworks中使用匿名方法</a> (4)</li><li>2010/06/24 -- <a href="http://cssrainbow.cn/tutorials/jquery/1331.html" title="打破重复的动画效果,基于CSS,MooTools or jQuery">打破重复的动画效果,基于CSS,MooTools or jQuery</a> (3)</li><li>2010/04/07 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1231.html" title="MooTools 1.2 Class 模板">MooTools 1.2 Class 模板</a> (0)</li><li>2010/03/30 -- <a href="http://cssrainbow.cn/tutorials/jquery/1225.html" title="关于‘TOP’置顶链接的那些事儿">关于‘TOP’置顶链接的那些事儿</a> (0)</li><li>2010/03/26 -- <a href="http://cssrainbow.cn/articles/web-roundups/1218.html" title="jQuery vs MooTools 专题系列">jQuery vs MooTools 专题系列</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/tutorials/mootools/1183.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>图片延迟加载，基于MooTools or jQuery</title>
		<link>http://cssrainbow.cn/tutorials/mootools/1168.html</link>
		<comments>http://cssrainbow.cn/tutorials/mootools/1168.html#comments</comments>
		<pubDate>Mon, 15 Mar 2010 09:35:05 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=1168</guid>
		<description><![CDATA[Lazy Load ，是延迟加载的意思。延迟加载可以推迟资源（通常是图像），减少流量，在包含很多大图片长页面中延迟加载图片可以加快页面加载速度。 浏览器将会在加载可见图片之后（第一屏就跳转）即进入就绪状态。 在某些情况下还可以帮助降低服务器负担。 ]]></description>
			<content:encoded><![CDATA[<p>
Lazy Load ，是延迟加载的意思。延迟加载可以推迟资源（通常是图像），减少流量，在包含很多大图片长页面中延迟加载图片可以加快页面加载速度。 浏览器将会在加载可见图片之后（第一屏就跳转）即进入就绪状态。 在某些情况下还可以帮助降低服务器负担。
</p>
<p>延迟加载技术，在淘宝（Taobao），腾讯和必应（Bing）等网站上已经应用。</p>
<p><img src="http://cssrainbow.cn/dw-content/demo11/Lazy-Load.png" width="448" height="555" alt="Lazy-Load"/> </p>
<p>我今天就给大家介绍几个网上比较好的延迟加载插件（Lazy Load Plugin）：</p>
<h2>Lazy Load Plugin for MooTools</h2>
<p>
<a class="button"  href="http://davidwalsh.name/mootools-lazyload">介绍</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://davidwalsh.name/dw-content/lazyload3.php">演示</a> &nbsp;&nbsp;&nbsp;<a class="button" href="http://davidwalsh.name/js/lazyload">插件下载</a>
</p>
<p><span id="more-1168"></span></p>
<h2>Lazy Load Plugin for jQuery</h2>
<p><a  class="button" href="http://www.neoease.com/lazy-load-jquery-plugin-delay-load-image/">介绍</a>&nbsp;&nbsp;&nbsp; <a class="button"  href="http://www.appelsiini.net/projects/lazyload/enabled.html">演示</a>&nbsp;&nbsp;&nbsp; <a class="button"  href="http://www.appelsiini.net/download/jquery.lazyload.js">插件下载</a></p>
<h2>Lazy Load for JavaScript</h2>
<p><a class="button"  href="http://www.cnblogs.com/cloudgamer/archive/2010/03/03/ImagesLazyLoad.html">介绍</a>&nbsp;&nbsp;&nbsp; <a  class="button" href="http://www.cnblogs.com/cloudgamer/archive/2010/03/03/ImagesLazyLoad.html">演示</a>&nbsp;&nbsp;&nbsp; <a class="button"  href="http://files.cnblogs.com/cloudgamer/ImagesLazyLoad.rar">插件下载</a></p>
<h3>知识扩展：</h3>
<ul>
<li><a  href="http://kissy.googlecode.com/svn/trunk/src/datalazyload/datalazyload.js">数据延迟加载组件</a></li>
<li><a  href="http://lifesinger.org/blog/2009/05/img-http-request/">图片的HTTP请求</a></li>
</ul>
<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2010/06/30 -- <a href="http://cssrainbow.cn/tutorials/jquery/1347.html" title="盒子（Box）中间的链接（Links）,基于MooTools or jQuery ">盒子（Box）中间的链接（Links）,基于MooTools or jQuery </a> (5)</li><li>2010/06/29 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1342.html" title="使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类">使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类</a> (0)</li><li>2010/06/27 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1333.html" title="在我喜欢的JavaScript Frameworks中使用匿名方法">在我喜欢的JavaScript Frameworks中使用匿名方法</a> (4)</li><li>2010/06/24 -- <a href="http://cssrainbow.cn/tutorials/jquery/1331.html" title="打破重复的动画效果,基于CSS,MooTools or jQuery">打破重复的动画效果,基于CSS,MooTools or jQuery</a> (3)</li><li>2010/03/30 -- <a href="http://cssrainbow.cn/tutorials/jquery/1225.html" title="关于‘TOP’置顶链接的那些事儿">关于‘TOP’置顶链接的那些事儿</a> (0)</li><li>2010/03/26 -- <a href="http://cssrainbow.cn/articles/web-roundups/1218.html" title="jQuery vs MooTools 专题系列">jQuery vs MooTools 专题系列</a> (5)</li><li>2010/03/18 -- <a href="http://cssrainbow.cn/tutorials/mootools/1183.html" title="jQuery 1.4, MooTools 1.2 比较">jQuery 1.4, MooTools 1.2 比较</a> (0)</li><li>2010/03/12 -- <a href="http://cssrainbow.cn/articles/web-roundups/1159.html" title="20个最佳的Lightbox效果收藏，基于MooTools or jQuery">20个最佳的Lightbox效果收藏，基于MooTools or jQuery</a> (0)</li><li>2010/03/08 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1143.html" title="在MooTools中实现类似于jQuery事件一样的语法">在MooTools中实现类似于jQuery事件一样的语法</a> (0)</li><li>2010/03/05 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1141.html" title="删除残破的图片（Broken Images），基于 MooTools or jQuery">删除残破的图片（Broken Images），基于 MooTools or jQuery</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/tutorials/mootools/1168.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>20个最佳的Lightbox效果收藏，基于MooTools or jQuery</title>
		<link>http://cssrainbow.cn/articles/web-roundups/1159.html</link>
		<comments>http://cssrainbow.cn/articles/web-roundups/1159.html#comments</comments>
		<pubDate>Fri, 12 Mar 2010 02:27:05 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery-Plugins]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[MooTools-Plugins]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=1159</guid>
		<description><![CDATA[大家都非常喜欢灯箱（Lightbox）效果，灯箱效果应用的地方很广，一直备受关注。人们已经根据原始的Lightbox 效果的启发，已经成功的克隆到所有流行的JavaScript库中了。

本文就是收藏网络上最受欢迎的10个MooTools的Lightbox效果和10个jQuery的Lightbox效果的大集合，也许其中一个Lightbox是你想要的。]]></description>
			<content:encoded><![CDATA[<p>
大家都非常喜欢灯箱（Lightbox）效果，灯箱效果应用的地方很广，一直备受关注。人们已经根据原始的Lightbox 效果的启发，已经成功的克隆到所有流行的JavaScript库中了。</p>
<p> 本文就是收藏网络上最受欢迎的<strong>10个MooTools的Lightbox效果</strong>和<strong>10个jQuery的Lightbox效果</strong>的大集合，也许其中一个Lightbox是你想要的。</p>
<blockquote>
<p>
原译文来自：<a href="http://line25.com/articles/rounding-up-the-top-10-jquery-lightbox-scripts">Rounding Up the Top 10 jQuery Lightbox Scripts</a></p>
<p>原译文来自：<a href="http://line25.com/articles/rounding-up-the-top-10-mootools-lightbox-scripts" target="_blank">Rounding Up the Top 10 Mootools Lightbox Scripts</a></p>
<p><strong>更多的Lightbox</strong> : <a href="http://cssrainbow.cn/tutorials/jquery/790.html">Lightbox 克隆 – 基于主流JavaScript库的Lightbox项目大集合</a> （推荐）</p>
<p><span id="more-1159"></span></p>
</blockquote>
<h2>Top 10 MooTools Lightbox Scripts </h2>
<h3><a href="http://gueschla.com/labs/smoothbox/">Smoothbox</a></h3>
<p><a href="http://gueschla.com/labs/smoothbox/"><br />
<img src="http://cssrainbow.cn/dw-content/demo10/mootools/Smoothbox.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images, Inline HTML, Ajax, iFrame</p>
<p><a class="button" href="http://gueschla.com/labs/smoothbox/">View Demo</a>&nbsp;&nbsp;&nbsp; <a class="button"  href="http://gueschla.com/labs/smoothbox/">Download</a></p>
<h3><a href="http://www.phatfusion.net/multibox/">Multibox</a></h3>
<p><a href="http://www.phatfusion.net/multibox/"><img src="http://cssrainbow.cn/dw-content/demo10/mootools/Multibox.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images, Inline HTML, AJAX, iFrame, Flash, Video</p>
<p><a  class="button"  href="http://www.phatfusion.net/multibox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a  class="button"  href="http://www.phatfusion.net/multibox/">Download</a></p>
<h3><a href="http://www.roebox.com/">RoeBox</a></h3>
<p><a href="http://www.roebox.com/"><img src="http://cssrainbow.cn/dw-content/demo10/mootools/RoeBox.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images</p>
<p><a  class="button" href="http://www.roebox.com/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://www.roebox.com/">Download</a></p>
<h3><a href="http://www.doknowevil.net/litebox/">Litebox</a></h3>
<p><a href="http://www.doknowevil.net/litebox/"><img src="http://cssrainbow.cn/dw-content/demo10/mootools/Litebox.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images</p>
<p><a class="button"  href="http://www.doknowevil.net/litebox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://www.doknowevil.net/litebox/">Download</a></p>
<h3><a href="http://reghellin.com/milkbox/">Milkbox</a></h3>
<p><a href="http://reghellin.com/milkbox/"><img src="http://cssrainbow.cn/dw-content/demo10/mootools/Milkbox.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images, Flash</p>
<p><a class="button"  href="http://reghellin.com/milkbox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://reghellin.com/milkbox/">Download</a></p>
<h3><a href="http://www.digitalia.be/software/slimbox">Slimbox</a></h3>
<p><a href="http://www.digitalia.be/software/slimbox"><img src="http://cssrainbow.cn/dw-content/demo10/mootools/Slimbox.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images</p>
<p><a class="button"  href="http://www.digitalia.be/demo/slimbox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://www.digitalia.be/software/slimbox#download">Download</a></p>
<h3><a href="http://bertramakers.com/moolabs/imagezoom.php">ImageZoom</a></h3>
<p><a href="http://bertramakers.com/moolabs/imagezoom.php"><img src="http://cssrainbow.cn/dw-content/demo10/mootools/ImageZoom.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images</p>
<p><a class="button"  href="http://bertramakers.com/moolabs/imagezoom.php">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://bertramakers.com/moolabs/imagezoom.php">Download</a></p>
<h3><a href="http://iaian7.com/webcode/mediaboxAdvanced">mediaboxAdvanced</a></h3>
<p><a href="http://iaian7.com/webcode/mediaboxAdvanced"><img src="http://cssrainbow.cn/dw-content/demo10/mootools/mediaboxAdvanced.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images, Inline HTML, AJAX, iFrame, Flash, Video</p>
<p><a class="button"  href="http://iaian7.com/webcode/mediaboxAdvanced#examples">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://iaian7.com/webcode/mediaboxAdvanced#installation">Download</a></p>
<h3><a href="http://www.andrewplummer.com/code/quickbox/">QuickBox</a></h3>
<p><a href="http://www.andrewplummer.com/code/quickbox/"><img src="http://cssrainbow.cn/dw-content/demo10/mootools/QuickBox.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images</p>
<p><a class="button"  href="http://www.andrewplummer.com/code/quickbox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://www.andrewplummer.com/code/quickbox/">Download</a></p>
<h3><a href="http://digitarald.de/project/remooz/">ReMooz</a></h3>
<p><a href="http://digitarald.de/project/remooz/"><img src="http://cssrainbow.cn/dw-content/demo10/mootools/ReMooz.jpg" alt="Mootools lightbox script"></a></p>
<p><strong>支持媒体:</strong> Images, Inline HTML</p>
<p><a class="button"  href="http://digitarald.de/project/remooz/1-0/showcase/flickr-big/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://digitarald.de/project/remooz/">Download</a></p>
<h2>Top 10 jQuery Lightbox Scripts</h2>
<h3><a href="http://leandrovieira.com/projects/jquery/lightbox/">jQuery Lightbox Plugin</a></h3>
<p><a href="http://leandrovieira.com/projects/jquery/lightbox/"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/lightbox.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images</p>
<p><a class="button"  href="http://leandrovieira.com/projects/jquery/lightbox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://leandrovieira.com/projects/jquery/lightbox/">Download</a></p>
<h3><a href="http://fancy.klade.lv/">Fancybox</a></h3>
<p><a href="http://fancy.klade.lv/"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/fancybox.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images, Inline HTML, iFrame</p>
<p><a class="button"  href="http://fancy.klade.lv/example">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://fancy.klade.lv/">Download</a></p>
<h3><a href="http://www.shadowbox-js.com/index.html">Shadowbox</a></h3>
<p><a href="http://www.shadowbox-js.com/index.html"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/shadowbox.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images, Inline HTML, iFrame, AJAX, Flash, Video</p>
<p><a  class="button"  href="http://www.shadowbox-js.com/index.html">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://www.shadowbox-js.com/index.html">Download</a></p>
<h3><a href="http://jquery.com/demo/thickbox/">ThickBox</a></h3>
<p><a href="http://jquery.com/demo/thickbox/"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/thickbox.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images, Inline HTML, iFrame, AJAX</p>
<p><a class="button"  href="http://jquery.com/demo/thickbox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://jquery.com/demo/thickbox/">Download</a></p>
<h3><a href="http://www.jasons-toolbox.com/SlightlyThickerbox/">Slightly Thickerbox</a></h3>
<p><a href="http://www.jasons-toolbox.com/SlightlyThickerbox/"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/slightly.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images, AJAX, Video</p>
<p><a class="button"  href="http://www.jasons-toolbox.com/SlightlyThickerbox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://www.jasons-toolbox.com/SlightlyThickerbox/">Download</a></p>
<h3><a href="http://orderedlist.com/articles/fancyzoom-meet-jquery">Fancy Zoom</a></h3>
<p><a href="http://orderedlist.com/articles/fancyzoom-meet-jquery"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/fancyzoom.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images, Inline HTML, Flash</p>
<p><a class="button"  href="http://orderedlist.com/demos/fancy-zoom-jquery/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://orderedlist.com/articles/fancyzoom-meet-jquery">Download</a></p>
<h3><a href="http://famspam.com/facebox">Facebox</a></h3>
<p><a href="http://famspam.com/facebox"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/facebox.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images, Inline HTML, AJAX</p>
<p><a class="button"  href="http://famspam.com/facebox">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://famspam.com/facebox">Download</a></p>
<h3><a href="http://nyromodal.nyrodev.com/">nyroModal</a></h3>
<p><a href="http://nyromodal.nyrodev.com/"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/nyromodal.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images, Inline HTML, iFrame, AJAX, Video</p>
<p><a class="button"  href="http://nyromodal.nyrodev.com/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://nyromodal.nyrodev.com/">Download</a></p>
<h3><a href="http://www.intelliance.fr/jquery/imagebox/">Interface Imagebox Demo</a></h3>
<p><a href="http://www.intelliance.fr/jquery/imagebox/"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/imagebox.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images</p>
<p><a class="button"  href="http://www.intelliance.fr/jquery/imagebox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://www.intelliance.fr/jquery/imagebox/">Download</a></p>
<h3><a href="http://www.pirolab.it/pirobox/">piroBox</a></h3>
<p><a href="http://www.pirolab.it/pirobox/"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/piro.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images</p>
<p><a class="button"  href="http://www.pirolab.it/pirobox/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://www.pirolab.it/pirobox/">Download</a></p>
<h3><a href="http://jquery.com/demo/grey/">Greybox Redux</a></h3>
<p><a href="http://jquery.com/demo/grey/"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/greybox.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images, iFrame</p>
<p><a class="button"  href="http://jquery.com/demo/grey/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://jquery.com/demo/grey/">Download</a></p>
<h3><a href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/">prettyPhoto</a></h3>
<p><a href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/"><img src="http://cssrainbow.cn/dw-content/demo10/jquery/piro.jpg" alt="Download Lightbox script"></a></p>
<p><strong>Supported Media:</strong> Images</p>
<p><a class="button"  href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/">View Demo</a>&nbsp;&nbsp;&nbsp;<a class="button"  href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/">Download</a></p>
<p>&#8212;- The End &#8212;-</p>
<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2009/11/10 -- <a href="http://cssrainbow.cn/tutorials/jquery/819.html" title="学会做一个简易的 Tooltip 效果，基于 MooTools or jQuery">学会做一个简易的 Tooltip 效果，基于 MooTools or jQuery</a> (3)</li><li>2009/10/18 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/773.html" title="自定义&#8217;outerClick&#8217; 事件,基于MooTools or jQuery">自定义&#8217;outerClick&#8217; 事件,基于MooTools or jQuery</a> (0)</li><li>2009/07/31 -- <a href="http://cssrainbow.cn/tutorials/jquery/561.html" title="三大“Sexy”特效库,基于mootools &#038; jQuery">三大“Sexy”特效库,基于mootools &#038; jQuery</a> (0)</li><li>2010/02/05 -- <a href="http://cssrainbow.cn/tutorials/mootools/1104.html" title="网页换肤,基于MooTools or jQuery">网页换肤,基于MooTools or jQuery</a> (1)</li><li>2010/08/08 -- <a href="http://cssrainbow.cn/articles/resources/1357.html" title="9大MooTools Plugins来改善网站的用户体验">9大MooTools Plugins来改善网站的用户体验</a> (0)</li><li>2010/06/30 -- <a href="http://cssrainbow.cn/tutorials/jquery/1347.html" title="盒子（Box）中间的链接（Links）,基于MooTools or jQuery ">盒子（Box）中间的链接（Links）,基于MooTools or jQuery </a> (5)</li><li>2010/06/29 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1342.html" title="使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类">使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类</a> (0)</li><li>2010/06/27 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1333.html" title="在我喜欢的JavaScript Frameworks中使用匿名方法">在我喜欢的JavaScript Frameworks中使用匿名方法</a> (4)</li><li>2010/06/24 -- <a href="http://cssrainbow.cn/tutorials/jquery/1331.html" title="打破重复的动画效果,基于CSS,MooTools or jQuery">打破重复的动画效果,基于CSS,MooTools or jQuery</a> (3)</li><li>2010/05/25 -- <a href="http://cssrainbow.cn/tutorials/mootools/1293.html" title="MooTabs plugin ,基于MooTools">MooTabs plugin ,基于MooTools</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/articles/web-roundups/1159.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10个jQuery过渡效果:移动的元素与样式</title>
		<link>http://cssrainbow.cn/articles/web-roundups/1135.html</link>
		<comments>http://cssrainbow.cn/articles/web-roundups/1135.html#comments</comments>
		<pubDate>Thu, 04 Mar 2010 01:31:01 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery 实例]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=1135</guid>
		<description><![CDATA[围剿 Flash 的不仅有 HTML 5，还有 JavaScript，著名的 JavaScript 框架 jQuery   在运动特效方面已经越来越流畅，有时候你需要点一下右键来确认它不是 Flash。本文介绍了10个非常出色的 jQuery   运动特效，这些效果可以更有效地展示你的内容。]]></description>
			<content:encoded><![CDATA[<p>围剿 Flash 的不仅有 HTML 5，还有 JavaScript，著名的 JavaScript 框架 jQuery   在运动特效方面已经越来越流畅，有时候你需要点一下右键来确认它不是 Flash。本文介绍了10个非常出色的 jQuery   运动特效，这些效果可以更有效地展示你的内容。</p>
<h3>1. 流感导航菜单</h3>
<p>下面的导航菜单，当鼠标在上面移动的时候，会很流畅地垂下解释菜单，当你将鼠标在上面快速左右移动的时候，会怀疑这是 Flash。</p>
<p><a href="http://addyosmani.com/resources/fluid-menu/fluid-menu.html"><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. 转花灯</h3>
<p>Roundabout 是一个 jQuery 插件，可以将一组 HTML 对象转换为旋转花灯的效果。</p>
<p><span id="more-1135"></span></p>
<p><a href="http://fredhq.com/projects/roundabout/#demo"><img src="http://devsnippets.com/img/jquery-magic/jquery-02.jpg" alt="Move    Elements with Style" /></a></p>
<h3>3. 拉洋片</h3>
<p>拉洋片也许是 jQuery 最拿手的效果了。该效果在遇到 JavaScript 被禁用的场合会自动降级使用。</p>
<p><a href="http://www.sohtanaka.com/web-design/examples/image-slider/"><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 插件</h3>
<p>这个让人赞叹的插件，可以对一组 HTML 对象重新洗牌，效果非常出众。</p>
<ul>
</ul>
<p><a href="http://razorjack.net/quicksand/demos/one-set-clone.html"><img src="http://devsnippets.com/img/jquery-magic/jquery-04.jpg" alt="jQuery    Quicksand Plugin" /></a></p>
<h3>5. 导航滑块</h3>
<p>这种风格的导航已经见于很多站点，鼠标在导航菜单上移动的时候，一个高亮指示条随着鼠标滑动，指示当前的导航位置。</p>
<p><a href="http://css-tricks.com/examples/MagicLine/"><img src="http://devsnippets.com/img/jquery-magic/jquery-05.jpg" alt="jQuery    Magic Line Sliding Style Navigation" /></a></p>
<h3>6. 文字的移动纹理</h3>
<p>在文字上，显示移动的纹理，效果美轮美奂。原理是，做一个带透明文字的 PNG 图像放在一个容器里，容器的背景放一张图案，用 jQuery   移动容器的背景，很简单，不过，不支持 IE6，因为 IE6 不支持 PNG。</p>
<p><a href="http://www.gayadesign.com/scripts/textmovingbg/"><img src="http://devsnippets.com/img/jquery-magic/jquery-06.jpg" alt="Text    with Moving Backgrounds" /></a></p>
<h3>7. jDiv: jQuery 导航 Tab</h3>
<p>一个可以显示丰富内容的下拉导航菜单（演示要翻墙）。</p>
<p><a href="http://www.skyrocketlabs.com/categories/tutorials/jdiv/demo/index.html"><img src="http://devsnippets.com/img/jquery-magic/jquery-07.jpg" alt="jDiv: A    jQuery navigation menu alternative" /></a></p>
<h3>8. 基于 CSS3 和 jQuery 的半透明导航系统</h3>
<p>鼠标在导航菜单上移动，显示半透明的指示图标。CSS3 做这个实在太容易了。</p>
<p><a href="http://demo.tutorialzine.com/2010/01/halftone-navigation-menu-jquery-css/demo.html"><img src="http://devsnippets.com/img/jquery-magic/jquery-08.jpg" alt="Halftone Navigation Menu With jQuery &amp; CSS3" /></a></p>
<h3>9. 云台式拉洋片</h3>
<p>常规的拉洋片效果要么左到右，要么右到左，或者垂直上下，这个 jQuery 效果可以象云台那样扫镜头。</p>
<p><a href="http://s3.amazonaws.com/buildinternet/live-tutorials/panning-slideshow/panning-slideshow.htm"><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 是一种新颖的内容展示方式，有点类似 Outlook 的手风琴菜单，但视觉效果和用户体验更好一些。</p>
<p><a href="http://www.slidedeck.com/"><img src="http://devsnippets.com/img/jquery-magic/jquery-10.jpg" alt="SlideDeck" /></a></p>
<p>本文来源：<a href="http://devsnippets.com/article/10-jquery-transition-effects.html">http://devsnippets.com/article/10-jquery-transition-effects.html</a></p>
<p>中文编译来源：<a href="http://www.comsharp.com"><strong>锐商企业CMS</strong> 网站内容管理系统</a> 官方网站</p>
<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2010/06/30 -- <a href="http://cssrainbow.cn/tutorials/jquery/1347.html" title="盒子（Box）中间的链接（Links）,基于MooTools or jQuery ">盒子（Box）中间的链接（Links）,基于MooTools or jQuery </a> (5)</li><li>2010/06/24 -- <a href="http://cssrainbow.cn/tutorials/jquery/1331.html" title="打破重复的动画效果,基于CSS,MooTools or jQuery">打破重复的动画效果,基于CSS,MooTools or jQuery</a> (3)</li><li>2010/03/30 -- <a href="http://cssrainbow.cn/tutorials/jquery/1225.html" title="关于‘TOP’置顶链接的那些事儿">关于‘TOP’置顶链接的那些事儿</a> (0)</li><li>2010/03/05 -- <a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1141.html" title="删除残破的图片（Broken Images），基于 MooTools or jQuery">删除残破的图片（Broken Images），基于 MooTools or jQuery</a> (0)</li><li>2010/02/24 -- <a href="http://cssrainbow.cn/tutorials/jquery/1111.html" title="网页随机换肤">网页随机换肤</a> (0)</li><li>2010/02/05 -- <a href="http://cssrainbow.cn/tutorials/mootools/1104.html" title="网页换肤,基于MooTools or jQuery">网页换肤,基于MooTools or jQuery</a> (1)</li><li>2010/02/03 -- <a href="http://cssrainbow.cn/tutorials/jquery/1078.html" title="Google-Style之元素褪色（Element Fading），基于MooTools or jQuery">Google-Style之元素褪色（Element Fading），基于MooTools or jQuery</a> (0)</li><li>2009/12/02 -- <a href="http://cssrainbow.cn/tutorials/jquery/835.html" title="在网站外部链接旁边添加Favorite Icons的方法，基于MooTools or jQuery">在网站外部链接旁边添加Favorite Icons的方法，基于MooTools or jQuery</a> (0)</li><li>2009/11/10 -- <a href="http://cssrainbow.cn/tutorials/jquery/819.html" title="学会做一个简易的 Tooltip 效果，基于 MooTools or jQuery">学会做一个简易的 Tooltip 效果，基于 MooTools or jQuery</a> (3)</li><li>2009/11/04 -- <a href="http://cssrainbow.cn/tutorials/jquery/805.html" title="创建一个‘精灵’导航菜单，基于 CSS Sprites And MooTools or jQuery ">创建一个‘精灵’导航菜单，基于 CSS Sprites And MooTools or jQuery </a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/articles/web-roundups/1135.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IE条件注释与CSS Hacks</title>
		<link>http://cssrainbow.cn/tutorials/xhtml-css/1130.html</link>
		<comments>http://cssrainbow.cn/tutorials/xhtml-css/1130.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 13:15:23 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[(X)HTML / CSS]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[CSS Hack]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=1130</guid>
		<description><![CDATA[IE条件注释与CSS Hacks]]></description>
			<content:encoded><![CDATA[<p>我们知道，IE6的存在，因其预装于目前市场占有率最大的 Windows XP 操作系统。对于老态龙钟的IE6，说拜拜还需要很长的时间。<br />
IE虽然给我们网页设计师，带来了不少多麻烦，还好，IE<a href="http://msdn2.microsoft.com/en-us/library/ms537512.aspx">条件注释</a>，给我们解决浏览器兼容问题带来了一个很好的方法。</p>
<h2>一、什么是IE条件注释？</h2>
<p>IE条件注释，顾名思义就是使用IE特有的条件语句来显示代码块。</p>
<p>这些巧妙的逻辑片段只能被IE浏览器所支持，其它的浏览器理解为纯粹的HTML注释，不起任何作用。条件注释在IE5中首次出现，并且得到了Widnows浏览器所有后续版本的支持。IE条件注释及其有效，而且非常容易记住。通过这些技巧，我们可以为基于Windows的IE5、6、7、8添加一些特殊的行为。这样做的好处是，HTML和CSS代码可以通过验证。主要的缺点是这些注释需要放在HTML页面中，而不是放在CSS中。这样，当你不需要这些东西，或者有所更改的时候，就需要维护很多的地方。好处是通过这种方式使用条件注释，可以很轻松的管理项目中的目标浏览器，并使得CSS补丁文件保持独立自由。更重要的是它帮助我们优化了  CSS样式表，保证了主要样式表的干净，这对于大型网站来说就很重要了，也许你还没有感觉到它的可爱之处。</p>
<p><span id="more-1130"></span></p>
<p>作为有Web标准意识的开发者，我们始终应该首先在大部分现有的兼容标准的浏览器上测试我们的设计，然后再为那些稍作细微修改就能回到正轨的浏览器提供补丁。</p>
<h2>二、条件注释使用方法</h2>
<h3>条件注释属性</h3>
<ul>
<li><strong>gt</strong> : greater than，选择条件版本以上版本，不包含条件版本</li>
<li><strong>lt</strong> : less than，选择条件版本以下版本，不包含条件版本</li>
<li><strong>gte</strong> : greater than or equal，选择条件版本以上版本，包含条件版本</li>
<li><strong>lte</strong> : less than or equal，选择条件版本以下版本，包含条件版本</li>
<li><strong>!</strong> : 选择条件版本以外所有版本，无论高低</li>
</ul>
<h3>The Code</h3>
<p>我们概括性地说明一下你如何使用条件注释，首先，我们应该把你所有的CSS
<link>等CSS文件放在<head>中。条件注释的基本结构和HTML的注释(<!-- -->)是一样的。因此 ，IE以外的浏览器将会把它们看  作是普通的注释而完全忽略它们。IE将会根据if条件来判断是否如解析普通的页面内容一样解析条件注释里的内容。条件注释使用的是HTML的注释结构，因此他们只能使用在HTML文件里，而不能在CSS文件中使用。</p>
<h4>Target ALL VERSIONS of IE（ 所有的IE可识别 ）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if IE<span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  	&lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;all-ie-only.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target everything EXCEPT IE （除IE外都可识别 ）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if !IE<span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;not-ie.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 7 ONLY （ 仅IE7可识别 ）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if IE <span style="color: #cc66cc;">7</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie7.css&quot;</span><span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 6 ONLY（仅IE6可识别）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if IE <span style="color: #cc66cc;">6</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie6.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 5 ONLY（仅IE5.0与IE5.5可以识别 ）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if IE <span style="color: #cc66cc;">5</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie5.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 5.0 ONLY (只有IE5.0可以识别 )</h4>
<p><!--[if IE 5.0]>
<link rel="stylesheet" type="text/css" href="ie50.css" />  <![endif]--> </p>
<h4>Target IE 5.5 ONLY（只有IE5.0可以识别）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if IE <span style="color: #cc66cc;">5.5000</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie55.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 6 and LOWER（IE6和IE6以下的）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if lt IE <span style="color: #cc66cc;">7</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie6-and-down.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if lte IE <span style="color: #cc66cc;">6</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie6-and-down.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 7 and LOWER（IE7和IE7以下的）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if lt IE <span style="color: #cc66cc;">8</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie7-and-down.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if lte IE <span style="color: #cc66cc;">7</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie7-and-down.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 8 and LOWER（IE8和IE8以下的）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if lt IE <span style="color: #cc66cc;">9</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie8-and-down.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if lte IE <span style="color: #cc66cc;">8</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie8-and-down.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 6 and HIGHER（IE6和IE6以上的）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if gt IE <span style="color: #cc66cc;">5.5</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie6-and-up.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if gte IE <span style="color: #cc66cc;">6</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie6-and-up.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 7 and HIGHER（IE7和IE7以上的）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if gt IE <span style="color: #cc66cc;">6</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie7-and-up.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if gte IE <span style="color: #cc66cc;">7</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie7-and-up.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h4>Target IE 8 and HIGHER（IE8和IE8以上的）</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if gt IE <span style="color: #cc66cc;">7</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie8-and-up.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if gte IE <span style="color: #cc66cc;">8</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;ie8-and-up.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h3>Universal IE 6 CSS（通用的IE 6样式）</h3>
<p>&nbsp;处理IE   6和IE6以下的版本始终是一个超特殊的挑战。老态龙钟的IE6，还保持着高额的市场占有率，还不能彻底的放弃它，不然会有许多的客户抱怨我们。不过也有些人正在放弃对它的支持，包括大企业，大型网络应用，甚至政府。有一个不失落的 ，不放弃的 解决办法，那就是使用一个特精简的样式<a href="http://css-tricks.com/snippets/html/universal-ie6-css/"> universal IE 6 CSS</a>.，然后为IE 7和以上（和所有其他浏览器）的应用常规的CSS。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;!--<span style="color: #00AA00;">&#91;</span>if !IE <span style="color: #cc66cc;">6</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>&lt;!--<span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> media<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;screen, projection&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;REGULAR-STYLESHEET.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!--&lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span>   
&lt;!--<span style="color: #00AA00;">&#91;</span>if gte IE <span style="color: #cc66cc;">7</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> media<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;screen, projection&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;REGULAR-STYLESHEET.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span>   
&lt;!--<span style="color: #00AA00;">&#91;</span>if lte IE <span style="color: #cc66cc;">6</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">&gt;</span>  &lt;link rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> media<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;screen, projection&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;http://universal-ie6-css.googlecode.com/files/ie6.0.3.css&quot;</span> /<span style="color: #00AA00;">&gt;</span>  &lt;!<span style="color: #00AA00;">&#91;</span>endif<span style="color: #00AA00;">&#93;</span>--<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<h2>IE6/IE7/FF的CSS Hacks</h2>
<h3>1.区别IE和非IE浏览器</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tip</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*非IE 背景藍色*/</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">red</span> \<span style="color: #cc66cc;">9</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE6、IE7、IE8背景紅色*/</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>2.区别IE6,IE7,IE8,FF</h3>
<p>【区别符号】：「\9」、「*」、「_」</p>
<p>【示例】：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#ue</span><span style="color: #00AA00;">&#123;</span> <span style="color: #808080; font-style: italic;">/*Firefox 背景变蓝色*/</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">red</span> \<span style="color: #cc66cc;">9</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE8 背景变红色*/</span>
    <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE7 背景变黑色*/</span>
    _background<span style="color: #00AA00;">:</span>orange<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE6 背景变橘色*/</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>
 【说明】：因为IE系列浏览器可读「\9」，而IE6和IE7可读「*」(米字号)，另外IE6可辨识「_」(底线)，因此可以依照顺序写下来，就会让浏  览器正确的读取到自己看得懂得CSS语法，所以就可以有效区分IE各版本和非IE浏览器(像是Firefox、Opera、Google  Chrome、Safari等)。
</p>
<h3>3.区别IE6、IE7、Firefox (方法 1) </h3>
<p>【区别符号】：「*」、「_」</p>
<p>【示例】：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tip</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*Firefox背景变蓝色*/</span>
    <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE7 背景变黑色*/</span>
    _background<span style="color: #00AA00;">:</span>orange<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE6 背景变橘色*/</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>  【说明】：IE7和IE6可读「*」(米字号)，IE6又可以读「_」(底线)，但是IE7却无法读取「_」，至于Firefox(非IE浏览器)则完全无法辨识「*」和「_」，因此就可以透过这样的差异性来区分IE6、IE7、Firefox。</p>
<h3> 4.区别IE6、IE7、Firefox (方法 2) </h3>
<p>【区别符号】：「*」、「!important」</p>
<p>【示例】：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tip</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*Firefox 背景变蓝色*/</span>
    <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">green</span> !important<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE7 背景变绿色*/</span>
    <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span>orange<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE6 背景变橘色*/</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>【说明】：IE7可以辨识「*」和「!important」，但是IE6只可以辨识「*」，却无法辨识「!important」，至于Firefox可以读取「!important」但不能辨识「*」因此可以透过这样的差异来有效区隔IE6、IE7、Firefox。</p>
<h3>5.区别IE7、Firefox </h3>
<p>【区别符号】：「*」、「!important」</p>
<p>【示例】：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tip</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*Firefox 背景变蓝色*/</span>
    <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">green</span> !important<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE7 背景变绿色*/</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>【说明】：因为Firefox可以辨识「!important」但却无法辨识「*」，而IE7则可以同时看懂「*」、「!important」，因此可以两个辨识符号来区隔IE7和Firefox。</p>
<h3>6.区别IE6、IE7 (方法 1) </h3>
<p>【区别符号】：「*」、「_」</p>
<p>【示例】：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tip</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE7 背景变黑色*/</span>
    _background<span style="color: #00AA00;">:</span>orange<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE6 背景变橘色*/</span>
    <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>【说明】：IE7和IE6都可以辨识「*」(米字号)，但IE6可以辨识「_」(底线)，IE7却无法辨识，透过IE7无法读取「_」的特性就能轻鬆区隔IE6和IE7之间的差异。</p>
<h3>7.区别IE6、IE7 (方法 2) </h3>
<p>【区别符号】：「!important」</p>
<p> 【示例】：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tip</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">black</span> !important<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE7 背景变黑色*/</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span>orange<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE6 背景变橘色*/</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>【说明】：因为IE7可读取「!important;」但IE6却不行，而CSS的读取步骤是从上到下，因此IE6读取时因无法辨识「!important」而直接跳到下一行读取CSS，所以背景色会呈现橘色。</p>
<h3>8.区别IE6、Firefox </h3>
<p>【区别符号】：「_」</p>
<p>【示例】：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tip</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*Firefox 背景变黑色*/</span>
    _background<span style="color: #00AA00;">:</span>orange<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*IE6 背景变橘色*/</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>【说明】：因为IE6可以辨识「_」(底线)，但是Firefox却不行，因此可以透过这样的差异来区隔Firefox和IE6，有效达成CSS hack。</p>
<h4>9. IE-6 ONLY</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> html <span style="color: #cc00cc;">#div</span> <span style="color: #00AA00;">&#123;</span>      <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h4>10. NON IE-7 ONLY:</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#div</span> <span style="color: #00AA00;">&#123;</span>     _height<span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h4>11. Hide from IE 6 and LOWER:</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#div</span> <span style="color: #00AA00;">&#123;</span>     <span style="color: #000000; font-weight: bold;">height</span><span style="color: #808080; font-style: italic;">/**/</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">html <span style="color: #00AA00;">&gt;</span> body <span style="color: #cc00cc;">#div</span> <span style="color: #00AA00;">&#123;</span>        <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h2>浏览器专属 CSS Hack:区分 Firefox / Opera / Safari / Internet Explorer</h2>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Opera */</span>  
html<span style="color: #3333ff;">:first-child </span><span style="color: #cc00cc;">#opera</span>  <span style="color: #00AA00;">&#123;</span>  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span>  
<span style="color: #808080; font-style: italic;">/* IE 7 */</span> 
<span style="color: #00AA00;">*</span><span style="color: #3333ff;">:first-child</span><span style="color: #00AA00;">+</span>html<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#F00</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* IE 7 */</span> 
 html <span style="color: #00AA00;">&gt;</span> body <span style="color: #cc00cc;">#ie7</span>  <span style="color: #00AA00;">&#123;</span>  <span style="color: #00AA00;">*</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span>  
<span style="color: #808080; font-style: italic;">/* IE 6 */</span> 
<span style="color: #00AA00;">*</span> html <span style="color: #cc00cc;">#div</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#F00</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* IE 6 */</span> 
 body <span style="color: #cc00cc;">#ie6</span>  <span style="color: #00AA00;">&#123;</span>  _display<span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span> 
&nbsp;
<span style="color: #808080; font-style: italic;">/*IE7及其更低版本*/</span>
<span style="color: #00AA00;">*</span><span style="color: #3333ff;">:first-child</span><span style="color: #00AA00;">+</span>html<span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span><span style="color: #00AA00;">*</span>html<span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*IE7,IE7以上和主流浏览器*/</span>
html<span style="color: #00AA00;">&gt;</span>body<span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*适合主流浏览器(IE7排除在外，IE7以下的也不行)*/</span> 
html<span style="color: #00AA00;">&gt;</span><span style="color: #808080; font-style: italic;">/**/</span>body<span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* Firefox 1 - 2 */</span> 
 body<span style="color: #3333ff;">:empty </span><span style="color: #cc00cc;">#firefox12</span>  <span style="color: #00AA00;">&#123;</span>  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span>  
<span style="color: #808080; font-style: italic;">/* Firefox */</span>  <span style="color: #a1a100;">@-moz-document url-prefix()  {  #firefox { display: block; }  } </span>
<span style="color: #808080; font-style: italic;">/* Safari */</span>  <span style="color: #a1a100;">@media screen and (-webkit-min-device-pixel-ratio:0)  {  #safari { display: block; }  } </span>
<span style="color: #808080; font-style: italic;">/* Opera */</span>  <span style="color: #a1a100;">@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0)  {  head~body #opera { display: block; }  }</span></pre></td></tr></table></div>

<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2010/08/17 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/1360.html" title="IE CSS Bug Table">IE CSS Bug Table</a> (1)</li><li>2010/04/15 -- <a href="http://cssrainbow.cn/code-snippets/css-code-snippets/1234.html" title="CSS中区别IE6, IE7和 IE8  的4个非常有用的字符">CSS中区别IE6, IE7和 IE8  的4个非常有用的字符</a> (1)</li><li>2010/03/09 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/1147.html" title="IE CSS Bugs 列表和解决方法 ">IE CSS Bugs 列表和解决方法 </a> (0)</li><li>2009/06/16 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/347.html" title="5种解决ie6下png图片透明的方法">5种解决ie6下png图片透明的方法</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/tutorials/xhtml-css/1130.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>网页设计中的面包屑导航：实例和最佳做法</title>
		<link>http://cssrainbow.cn/articles/resources/1033.html</link>
		<comments>http://cssrainbow.cn/articles/resources/1033.html#comments</comments>
		<pubDate>Tue, 26 Jan 2010 13:59:20 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[Breadcrumb Navigation]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=1033</guid>
		<description><![CDATA[在一个拥有很多页面的网站上，面包屑导航(breadcrumb navigation)可以大大提高用户导引的方式。换句话说，面包屑(breadcrumb)可以减少网站访问者找寻更深级别页面的步骤，并且改善了网站区块和页面的可访问性。]]></description>
			<content:encoded><![CDATA[<p>在一个拥有很多页面的网站上，面包屑导航(breadcrumb navigation)可以大大提高用户导引的方式。换句话说，面包屑(breadcrumb)可以减少网站访问者找寻更深级别页面的步骤，并且改善了网站区块和页面的<a href="http://en.wikipedia.org/wiki/Findability">可访问性</a>。而且面包屑(breadcrumb)还是一个有效的直观标识来告诉使用者他们当前的位置，是当前登录页面最好的上下文信息资源。</p>
<h2>什么是面包屑(breadcrumb)?</h2>
<p>“面包屑(breadcrumb)”是<strong>二级导航计划</strong>的一种形式，可以清楚的标明当前用户所在的网站或网络应用的位置。该术语源自<a href="http://en.wikipedia.org/wiki/Hansel_and_Gretel">《奇幻森林历险记》（Hansel and Gretel）</a> 这篇童话故事，两个小孩子通过丢面包屑来标记回家的踪迹。和童话故事中一样，面包屑(breadcrumb)在现实应用中可以提供给用户追踪原始登陆点的方式。</p>
<p><span id="more-1033"></span></p>
<p><img title="interactive_delicious" src="http://cssrainbow.cn/Project/CSS-HTML/demo15/interactive_delicious.jpg" alt="interactive_delicious" width="243" height="99" /><br />
<em><a href="http://delicious.com/SixRevisions/webdesign+design">Delicious.com</a>上的面包屑(breadcrumb)</em></p>
<p>通常你可以在一些内容量极大，并且使用分级结构的网站上看到面包屑(breadcrumb)。你也可以在一些具有多重步骤的应用程序上看到它们。面<br />
  包屑(breadcrumb)的结构非常简单，水平排放了一些文本链接，并且用大于号隔开(&gt;)；这个符号标明了当前页面与相邻页面之间的层级关<br />
  系。</p>
<p>本文，我们将探讨面包屑(breadcrumb)在网站中的使用方法以及提供一些好的案例供参考。</p>
<h2>什么时候需要使用面包屑(breadcrumb)?</h2>
<p>大型网站或者具有层级结构页面的网站需要使用<strong>面包屑导航(breadcrumb navigation)</strong>。最好的例子就是一个电子商务网站，这种网站的产品都会根据逻辑分类进行归组。</p>
<p>对于一些仅有一级结构的网站你<strong>不需要</strong>使用面包屑(breadcrumb)。一个决定是否需要使用面包屑(breadcrumb)最好的办法就是建立一个<a href="http://en.wikipedia.org/wiki/Site_map">网站地图</a>或者用图表画出网站导航结构，并且分析一下使用面包屑(breadcrumb)是否可以改善用户在分类之间的导引动作。</p>
<p>面包屑导航（Breadcrumb navigation）只能作为一个网站附属的特性而不能代替主导航。它是一个方便的功能，一个<strong>二级导航计划</strong>可以让用户确认他的当前位置，并且是你的网站导航的另一种表现方式。</p>
<h2>面包屑(breadcrumb)的形式</h2>
<p>下面介三种主要的面包屑(breadcrumb)形式。</p>
<p><strong>基于位置的(Location-based)<br />
</strong></p>
<p>基于位置的面包屑(breadcrumb)可以告诉用户他们当前所在的网站层级。最具代表性的就是用在具有多级别（通常大于两级）的导航中。下面的示例 (<a href="http://www.sitepoint.com/article/introducing-joomla/">SitePoint</a>)中，每一个文本链接的层级都大于各自右侧的文本链接。</p>
<p><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/location_based_breadcrumb_example_sitepoint.jpg" alt="Example of location-based breadcrumb." width="500" height="179" /></p>
<p><strong>基于属性的(Attribute-based)<br />
</strong></p>
<p>基于属性的面包屑(breadcrumb)路径显示了特定页面的属性。例如，在<a href="http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&amp;N=2010090007%2050001375%201054808291&amp;name=MicroATX%20Mini%20Tower">Newegg</a>网站中，面包屑(breadcrumb)路径显示了特定页面上项目的属性。</p>
<p><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/newegg_attribute_based_navigation.jpg" alt="Example of attribute-based breadcrumbs." width="500" height="109" /></p>
<p>该页面显示了所有具有制造者为“<em>Lian Li”</em>这个属性的计算机，同时他们还具有“<em>MicroATX Mini Towe</em>r”这个表单元素。</p>
<p><strong>基于路径的(Path-based)</strong></p>
<p><strong></strong>基于路径的面包屑(breadcrumb)像用户提示了他们达到特定页面的步骤。这种形式的面包屑(breadcrumb)是动态的，因为它们显示的页面是用户在到达当前页面之前已经访问过的页面。</p>
<h2>使用面包屑(breadcrumb)的好处</h2>
<p>使用面包屑(breadcrumb)有以下几点好处：</p>
<p><strong>为用户带来方便</strong></p>
<p>使用面包屑(breadcrumb)主要是为用户提供站内导航的另一种方式。通过在多级结构的网站上为所有页面提供面包屑(breadcrumb)路径，用户可以更容易的定位到高级别的页面。</p>
<p><strong>减少返回高级别页面的点击数量或动作</strong></p>
<p>代替使用浏览器的返回按钮或者网站的主导航返回到高级别页面，用户现在可以通过面包屑(breadcrumb)使用更少的点击到达目的地。</p>
<p><strong>通常不占用屏幕空间</strong></p>
<p>因为通常都是使用水平方向且不进行格式化，面包屑(breadcrumb)路径不需要占用页面很多空间。这样的好处就是他们对于内容的加载没有任何负面影响，并且如果使用得得当的话将化解其他负载。</p>
<p><strong>减少跳出率</strong></p>
<p>面包屑(breadcrumb)路径对于吸引首次访问者进入当前加载页面以后继续查看网站其他内容是一个非常棒的方式。例如，当一个用户通过<br />
  google搜索进入到一个页面，看到一个面包屑(breadcrumb)路径的时候可能会试图点击更高级别的页面来查看相关感兴趣的文章。这样依赖，就<br />
  可以减少整个网站的跳出率。</p>
<h2>使用面包屑(breadcrumb)的常见错误</h2>
<p>使用面包屑(breadcrumb)是意见十分简单的事情，在决定是否需要使用他们之前仅仅需要考虑几点建议。下面让我们看看需要避免的一些错误使用情况。</p>
<p><strong>在不要使用的时候而使用了面包屑(breadcrumb)</strong></p>
<p>最易发生的错误就是面包屑(breadcrumb)对于网站没有任何益处的时候而使用了它。</p>
<p><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/simple_pie_mistake.jpg" alt="Using breadcrumbs when you do not need it." width="500" height="200" /></p>
<p>在上面的例子中，<a href="http://www.slicethepie.com/Music/Default.aspx">Slicethepie</a>为<br />
  使用者提供了太多的导航选择。 (1) 主导航， (2) 面包屑(breadcrumb)路径以及<br />
  (3)二级导航的位置都十分接近。面包屑(breadcrumb)在这里并没有为用户提供什么方便之处，因为二级导航已经直接显示出了下级页面。而且，点<br />
  击面包屑(breadcrumb)上的二级链接 (”Music”)将把你代回到一级标签<br />
  (”Listen”)，这将错误的向你提示第一个标签会比第二个标签(”Search” 和 “Artist hall of fame”)级别高。</p>
<p><strong>将面包屑(breadcrumb)作为主导航</strong></p>
<p>正如前所属，使用面包屑(breadcrumb)仅仅是一种可选的导航方案。</p>
<p><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/mefeedia.jpg" alt="Using breadcrumbs as primary navigation./" width="496" height="128" /></p>
<p>在上面的例子中，<a href="http://www.mefeedia.com/entry/fri-feb-27-2009/14804198">mefeedia</a>并没有提供主要的查看视频的导航菜单。尽管这里在页脚部分有一个文字链接导航，但是在页面主体上并没有一个导航菜单，从而使得网站其他部分的定位非常困难。</p>
<p><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/mefeedia_2_primary_nav.jpg" alt="Using breadcrumbs trails as primary navigation - example 2." width="500" height="381" /></p>
<p>假设你通过Google直接到达了视频页面，那么可供你使用的导航仅有面包屑(breadcrumb)。也就是说如果你已经浏览了网站的其他页面并且到达了一个没有主导航菜单的页面，那么你不得不使用浏览器的“返回”按钮访问主菜单。</p>
<p><strong>当页面具有多种分类的时候使用面包屑(breadcrumb)</strong></p>
<p>面包屑(breadcrumb)具有一个线性结构，因此当你的页面分类种类较多的时候使用它会比较困难。决定是否需要使用面包屑<br />
  (breadcrumb)通常都很大的依赖于你的网站结构设计。当一个低级别的页面具有一个以上的父级分类，那么使用面包屑(breadcrumb)是无<br />
  效的，不精确的，而且会让用户非常迷糊。</p>
<h2>面包屑(breadcrumb)导航设计考虑因素</h2>
<p>当设计面包屑(breadcrumb)导航计划的时候，需要在大脑中牢记几点。让我们一起来看看当你设计面包屑(breadcrumb)的时候可能会遇到的问题。</p>
<p><strong>应该用什么区分开链接项目？</strong></p>
<p>通常被接受并且广泛认知的区分面包屑(breadcrumb)超级链接的符号就是大于号(&gt;)。最具代表性的说，大于号用来表示层级结构，像这样的结构<em>主分类&gt;子分类。</em></p>
<p><a href="http://www.google.com/support/websearch/bin/answer.py?hl=en&amp;answer=134479"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/greater_than_symbol_google.jpg" alt="Example of greater than symbols separating the text links." width="433" height="136" /></a></p>
<p>Other symbols used are arrows pointing to the right, right angle quotation marks (») and slashes (/).</p>
<p><a href="http://www.uxmatters.com/topics/ajax-rias-web-20-apps/"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/forward_slashes_uxmatters.jpg" alt="Example of alternative hierarchy separators." width="438" height="100" /></a></p>
<p>选择使用什么样子的分隔符依赖于整个网站的美观设计以及所使用的面包屑(breadcrumb)形式。比如，基于路径的面包屑(breadcrumb)就不需要在每个链接文本之间提供层级关系，使用大于号并不能精确的传递他们之间的关系。</p>
<p><strong>面包屑(breadcrumb)应该多大？</strong></p>
<p>你无需让面包屑(breadcrumb)占据网页的主导位置。一个面包屑(breadcrumb)仅仅扮演用户使用助手的功能。它的尺寸只需可以传到足够的信息给用户足以，因此可以很小，或者比主导航小一些。</p>
<p><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/size_of_breadcrumb_campaign_monitor.jpg" alt="An example of a good-sized breadcrumb trail." width="499" height="318" /></p>
<p>上图像我们显示了一个非常好的原则就是面包屑(breadcrumb)不能作为用户到达页面的时候被第一眼吸引的东西。</p>
<p><strong>面包屑(breadcrumb)应该放在什么位置？</strong></p>
<p>面包屑(breadcrumb)通常显示也页面的上半部分，如果导航菜单使用的是水平方向的话就在主导航菜单下方即可。</p>
<h2>面包屑(breadcrumb)展示</h2>
<p>我们已经讨论过了面包屑(breadcrumb)的6W(who, what, when, where, why以及how)，下面来看看一些实例。以下部分你将看到一些非常棒的网站上使用面包屑(breadcrumb)的例子。</p>
<h2>1. 经典的基于文本的面包屑(breadcrumb)</h2>
<p><a href="http://www.typepad.com/go/design-assistant/">TypePad Design Assistant</a></p>
<p><a href="http://www.typepad.com/go/design-assistant/"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/typical_breadcrumb_typepad.jpg" alt="classic breadcrumb - example 1." width="495" height="78" /></a></p>
<p><a href="http://www.nasa.gov/news/budget/index.html">NASA</a></p>
<p><a href="http://www.nasa.gov/news/budget/index.html"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/greater_than_symbol_nasa.jpg" alt="Classic text-based breadcrumbs" width="280" height="132" /></a></p>
<p><a href="http://www.nestle.com/SharedValueCSR/Overview.htm">Nestle</a> 使用的面包屑(breadcrumb)文本是页面上最小的文本，有效的体现了面包屑(breadcrumb)的谦逊而不唐突。</p>
<p><a href="http://www.nestle.com/SharedValueCSR/Overview.htm"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/greater_than_symbol_nestle.jpg" alt="Nestle example." width="500" height="474" /></a></p>
<p><a href="http://www.marchanddetrucs.com/magasin-de-magie/thematiques/close-up/autres/">Marchand de Trucs</a></p>
<p><a href="http://www.marchanddetrucs.com/magasin-de-magie/thematiques/close-up/autres/"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/typical_breadcrumb_marchand.jpg" alt="classic breadcrumb - example 2." width="500" height="150" /></a></p>
<p><a href="http://www.bridge55.com/t-shirts/gio-goi/gio-goi-key-t-shirt-bas100202-black.html">Bridge 55</a></p>
<p><a href="http://www.bridge55.com/t-shirts/gio-goi/gio-goi-key-t-shirt-bas100202-black.html"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/typical_breadcrumb_bridge_55.jpg" alt="classic breadcrumb - example 3." width="500" height="150" /></a></p>
<p><a href="http://www.overstock.com/Home-Garden/Beds/Twin,/bed-size,/2013/subcat.html">Overstock.com</a> 在它基于属性的面包屑(breadcrumb)上使用了标准的大于号，并且为产品属性使用了选择框，这样用户就无需再对它们进行筛选。</p>
<p><a href="http://www.overstock.com/Home-Garden/Beds/Twin,/bed-size,/2013/subcat.html"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/typical_breadcrumb_overstock.jpg" alt="classic breadcrumb - example 4." width="505" height="167" /></a></p>
<h2>2. 使用其他符号代替 “&gt;”</h2>
<p><a href="http://www.techradar.com/news/computing">TechRadar UK</a> 和&nbsp;<a href="http://www.bp.com/productslistsearch.do?categoryId=9007366&amp;contentId=7014115">BP</a> 使用向右的三角。</p>
<p><a href="http://www.techradar.com/news/computing"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/replacing_techradar.jpg" alt="Using other symbols for hierachy separators - example 2." width="495" height="78" /></a></p>
<p><a href="http://www.techradar.com/news/computing"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/replacing_bp.jpg" alt="Replacing the greater than symbol example." width="413" height="136" /></a></p>
<p><a href="http://psd.tutsplus.com/category/tutorials/drawing/">PSDTUTS</a> 和&nbsp;<a href="http://www.uniquemartique.com/site/martique/product/291">Martique</a> 使用了破折号。</p>
<p><a href="http://psd.tutsplus.com/category/tutorials/drawing/"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/replacing_psdtuts.jpg" alt="Using other symbols for hierachy separators - example 3." width="500" height="111" /></a></p>
<p><a href="http://www.uniquemartique.com/site/martique/product/291"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/replacing_martique.jpg" alt="Using other symbols for hierachy separators - example 4." width="500" height="106" /></a></p>
<p><a href="http://www.mousetominx.co.uk/products.php?cat=7">Mouse to Minx</a> 使用了向右的箭头来表示页面的层级关系。</p>
<p><a href="http://www.mousetominx.co.uk/products.php?cat=7"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/replacing_mouse_to_minx.jpg" alt="Using other symbols for hierachy separators - example 5." width="500" height="106" /></a></p>
<p><a href="http://www.useit.com/alertbox/pr.html">Jakob Nielsen’s Alertbox</a> 使用了右箭头。</p>
<p><a href="http://www.useit.com/alertbox/pr.html"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/replacing_usitdotcome.jpg" alt="Using other symbols for hierachy separators - example 1." width="495" height="78" /></a></p>
<p><a href="http://www.target.com/Beach-Towels-Bath-Bed/b/ref=sc_fe_l_2/176-1138487-8856958?ie=UTF8&amp;node=1041470">Target</a> 使用了半角冒号 (:) 。</p>
<p><a href="http://www.target.com/Beach-Towels-Bath-Bed/b/ref=sc_fe_l_2/176-1138487-8856958?ie=UTF8&amp;node=1041470"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/replacing_target.jpg" alt="semicolon separator example." width="413" height="88" /></a></p>
<h2>3. 超越简单的文字链接</h2>
<p>现在的面包屑(breadcrumb)设计趋势用简单的一句话来说就是“面包屑(breadcrumb)不一定是普通的”。在下面的示例中，你将看到一些与整个网站设计风格完美结合的漂亮的面包屑(breadcrumb)样式。</p>
<p><a href="http://listen.grooveshark.com/">Grooveshark</a></p>
<p><a href="http://listen.grooveshark.com/"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/beautifully_groove_shark.jpg" alt="styled breadcrumbs - example 1." width="459" height="81" /></a></p>
<p><a href="http://tv.yahoo.com/the-10-000-pyramid/show/28443/castcrew">Yahoo! TV</a></p>
<p><a href="http://tv.yahoo.com/the-10-000-pyramid/show/28443/castcrew"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/beautifully_yahootv.jpg" alt="Beautiful breadcrumb trails." width="378" height="98" /></a></p>
<p><a href="http://www.ideo.com/work/item/s500/">IDEO</a></p>
<p><a href="http://www.ideo.com/work/item/s500/"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/beautifully_ideo.jpg" alt="styled breadcrumbs - example 2." width="505" height="167" /></a></p>
<p><a href="http://store.apple.com/us/product/MB352LL/B?fnode=MTY1NDA4NA&amp;mco=MTY1OTg1Nw">Apple Store</a></p>
<p><a href="http://store.apple.com/us/product/MB352LL/B?fnode=MTY1NDA4NA&amp;mco=MTY1OTg1Nw"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/beautifully_apple.jpg" alt="styled breadcrumbs - example 3." width="505" height="167" /></a></p>
<p><a href="http://coolspotters.com/entertainment/websites">Coolspotters</a></p>
<p><a href="http://coolspotters.com/entertainment/websites"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/beautifully_coolspotters.jpg" alt="styled breadcrumbs - example 4." width="505" height="167" /></a></p>
<p><a href="http://www.devlounge.net/design/sidebars-that-rock">Devlounge</a></p>
<p><a href="http://www.devlounge.net/design/sidebars-that-rock"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/beautifully_devlounge.jpg" alt="styled breadcrumbs - example 5." width="495" height="127" /></a></p>
<p><a href="https://launchpad.net/lottanzb">LottaNZB</a></p>
<p><a href="https://launchpad.net/lottanzb"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/beautifully_launchpad.jpg" alt="" width="330" height="74" /></a></p>
<p><a href="http://www.pixelpoodle.com/?action=news&amp;id=24">Pixelpoodle</a></p>
<p><a href="http://www.pixelpoodle.com/?action=news&amp;id=24"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/beautifully_pixeldoodle.jpg" alt="Beautifully-styled breadcrumbs - example." width="425" height="65" /></a></p>
<p><a href="http://www.guardian.co.uk/world/obama-administration">guardian.co.uk</a></p>
<p><a href="http://www.guardian.co.uk/world/obama-administration"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/beautifully_guardianuk.jpg" alt="Beautiful navigation - examples." width="500" height="150" /></a></p>
<h2>4. 多步过程的面包屑(breadcrumb)</h2>
<p><a href="https://www.statementstacker.com/register/step2">Statement Tracker</a> 使用了面包屑(breadcrumb)路径来标示帐号注册的步骤。</p>
<p><a href="https://www.statementstacker.com/register/step2"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/sequential_statementtracker.jpg" alt="Sequential process example." width="500" height="204" /></a></p>
<p><a href="http://flickr.com/tour/">Flickr</a> 使用面包屑(breadcrumb)来标示Flickr使用方法的单元数字。</p>
<p><a href="http://flickr.com/tour/"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/sequential_flickr.jpg" alt="breadcrumb" width="372" height="84" /></a></p>
<h2>5. 带有子导航的面包屑(breadcrumb)</h2>
<p>下面将向你展示一些这样的面包屑(breadcrumb)样式，当用鼠标点击或者悬浮在链接上的时候会打开一个子导航面板列出一些附加属性或者位置。</p>
<p><a href="http://www.marketwatch.com/newscommentary/industries/technology">MarketWatch</a></p>
<p><a href="http://www.marketwatch.com/newscommentary/industries/technology"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/subnav_marketwatch.jpg" alt="breadcrumb with sub-navigation example." width="413" height="166" /></a></p>
<p><a href="http://www.profoto.com/products/profoto/lightshapingtools">Profoto</a> 具有一个独特的面包屑(breadcrumb)：点击面包屑(breadcrumb)上的链接将会在下方打开一个区块向用户显示附加的属性以供选择。</p>
<p><a href="http://www.profoto.com/products/profoto/lightshapingtools"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/primary_nav_protofoto.jpg" alt="Experimental Example 2." width="500" height="152" /></a></p>
<p><a href="http://www.som.cranfield.ac.uk/som/p858/About-Cranfield/Location/Getting-to-Cranfield-via-Public-Transport">Cranfield University</a></p>
<p><a href="http://www.som.cranfield.ac.uk/som/p858/About-Cranfield/Location/Getting-to-Cranfield-via-Public-Transport"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/primary_nav_cranfield.jpg" alt="Flyout Breadcrumbs" width="366" height="291" /></a></p>
<p><a href="http://www.lonelyplanet.com/germany/north-rhine-westphalia/cologne">Lonely Planet</a> 同样具有一个fly-out样式的面包屑(breadcrumb)供你改变属性。</p>
<p><a href="http://www.lonelyplanet.com/germany/north-rhine-westphalia/cologne"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/primary_nav_lonely_planet.jpg" alt="flyout menu - example 3." width="471" height="74" /></a></p>
<p>点击一个面包屑(breadcrumb)链接将会打开相应项目的页面，同时点击向下的那个按钮会打开附加的选项。</p>
<p><a href="http://www.lonelyplanet.com/germany/north-rhine-westphalia/cologne"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/primary_nav_lonely_planet_2.jpg" alt="Flyout menu - example 4." width="500" height="302" /></a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/cc295790.aspx">MSDN</a> 的面包屑(breadcrumb)具有一个可以打开二级导航列表的滚动面板。</p>
<p><a href="http://msdn.microsoft.com/en-us/library/cc295790.aspx"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/subnav_msdn.jpg" alt="subnavigation example 1." width="428" height="250" /></a></p>
<p><a href="http://www.wowhead.com/?spells=7.11.574">Wowhead</a> 的面包屑(breadcrumb)具有一个多级别的二级导航</p>
<p><a href="http://www.wowhead.com/?spells=7.11.574"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/subnav_wowhead.jpg" alt="" width="399" height="154" /></a></p>
<h2>6. 具有交互功能的面包屑(breadcrumb)</h2>
<p><a href="http://delicious.com/SixRevisions/webdesign+design">Delicious</a> 可以让你移除面包屑(breadcrumb)上面的项目来帮你快速定位书签。</p>
<p><a href="http://delicious.com/SixRevisions/webdesign+design"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/interactive_delicious.jpg" alt="interactive example 1." width="243" height="99" /></a></p>
<h2>7. 具有实验性的示例</h2>
<p><a href="http://www.booreiland.nl/">Booreiland</a> 使用了一个面包屑(breadcrumb)风格的导航计划作为主菜单，允许用户快速理解他们当前所浏览的内容。</p>
<p><a href="http://www.booreiland.nl/"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/primary_nav_booreiland.jpg" alt="Experimental example 1." width="500" height="215" /></a></p>
<p>用户交互设计师，<a href="http://aenui.com/about-me/">AEN UI</a>的Aen Tan发明了一种称为 “<a href="http://aenui.com/user-interface/tabcrumbs-best-of-both-worlds/">Tabcrumbs</a>”的设计方式，即一个将标签和面包屑(breadcrumb)组合在一起的导航计划。</p>
<p><a href="http://aenui.com/about-me/"><img src="http://cssrainbow.cn/Project/CSS-HTML/demo15/primary_nav_superbots.jpg" alt="Tabcrumbs example." width="458" height="191" /></a></p>
<blockquote>
<p>
原英文来自：<a href="http://www.smashingmagazine.com/2009/03/17/breadcrumbs-in-web-design-examples-and-best-practices-2/">Breadcrumbs In Web Design: Examples And Best Practices </a>
</p>
<p>译文来自：<a href="http://www.4ebstudio.com/breadcrumbs-in-web-design-examples-and-best-practices.html">网站面包屑(breadcrumb)设计实例解析</a></p>
</blockquote>
<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2010/03/04 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/1137.html" title="Web 设计中的 5 个最具争议性的话题">Web 设计中的 5 个最具争议性的话题</a> (0)</li><li>2009/10/20 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/779.html" title="让XHTML/CSS页面可正常打印 (收藏)">让XHTML/CSS页面可正常打印 (收藏)</a> (0)</li><li>2009/08/31 -- <a href="http://cssrainbow.cn/articles/resources/671.html" title="Opera的Web标准课程（推荐）">Opera的Web标准课程（推荐）</a> (1)</li><li>2009/08/19 -- <a href="http://cssrainbow.cn/articles/general/646.html" title="Web前端开发需要掌握的技能(图解)">Web前端开发需要掌握的技能(图解)</a> (0)</li><li>2009/07/03 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/380.html" title="30个富有创意的Web设计">30个富有创意的Web设计</a> (0)</li><li>2010/09/02 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/1375.html" title="图像替换技术的最佳实战">图像替换技术的最佳实战</a> (2)</li><li>2010/04/15 -- <a href="http://cssrainbow.cn/code-snippets/css-code-snippets/1234.html" title="CSS中区别IE6, IE7和 IE8  的4个非常有用的字符">CSS中区别IE6, IE7和 IE8  的4个非常有用的字符</a> (1)</li><li>2010/01/25 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/961.html" title="Sexy Bookmarks 效果，基于CSS">Sexy Bookmarks 效果，基于CSS</a> (0)</li><li>2010/01/25 -- <a href="http://cssrainbow.cn/articles/web-roundups/941.html" title="15个富有创意的Web表单设计,基于CSS">15个富有创意的Web表单设计,基于CSS</a> (0)</li><li>2010/01/14 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/882.html" title="实现侧边栏滚动的多种技术，基于CSS,jQuery or MooTools ">实现侧边栏滚动的多种技术，基于CSS,jQuery or MooTools </a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/articles/resources/1033.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>15个富有创意的Web表单设计,基于CSS</title>
		<link>http://cssrainbow.cn/articles/web-roundups/941.html</link>
		<comments>http://cssrainbow.cn/articles/web-roundups/941.html#comments</comments>
		<pubDate>Mon, 25 Jan 2010 02:36:28 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Form Design]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=941</guid>
		<description><![CDATA[我们都知道，表单是网页的重要组成部分，它是网站与用户进行交互的窗口。然而表单中固定的诸如说明文字、输入框、提交按钮等元素，使得表单设计略显乏味，  难有创新，这一点不少Web设计师深有体会。好的Web设计师就是可以在平凡处挖亮点，让表单设计或耳目一新，或整洁素雅。下面就来看这样的15个基于CSS的优秀表单设计。]]></description>
			<content:encoded><![CDATA[<p>我们都知道，表单是网页的重要组成部分，它是网站与用户进行交互的窗口。然而表单中固定的诸如说明文字、输入框、提交按钮等元素，使得表单设计略显乏味，  难有创新，这一点不少Web设计师深有体会。好的Web设计师就是可以在平凡处挖亮点，让表单设计或耳目一新，或整洁素雅。下面就来看这样的15个基于CSS的优秀表单设计。 </p>
<p>译文来自：<a href="http://www.webdeveloperjuice.com/2009/12/26/coolest-15-css-based-html-forms-rarely-seen/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.webdeveloperjuice.com');">Coolest 15 css based html forms rarely seen</a><br />
中文原文：<a href="http://css9.net/15-css-based-html-form-design/">15个基于CSS的Form表单设计</a></p>
<p><span id="more-941"></span></p>
<h3>1. Footytube</h3>
<p><a href="http://www.footytube.com/"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/9-footytube.jpg" alt="" title="footytube" width="530" height="326" /></a>
</p>
<h3>2. Go Squared</h3>
<p><a href="https://www.gosquared.com/join/"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/GoSquared.jpg" alt="" title="GoSquared" width="530" height="399" /></a></p>
<h3>3. Next BIg Sound</h3>
<p><a href="http://www.nextbigsound.com/signup"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/Next-Big-Sound.jpg" alt="" title="Next-Big-Sound" width="530" height="363" /></a></p>
<h3>4. PSD Themes</h3>
<p><a href="http://psdthemes.com/sign-up.php?plan=dev"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/PSDThemes.jpg" alt="" title="PSDThemes" width="530" height="580" /></a></p>
<h3>5. Food Spotting</h3>
<p><a href="http://www.foodspotting.com/ilovefood"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/Foodspotting.jpg" alt="" title="Foodspotting" width="530" height="521" /></a></p>
<h3>6. Gowalla</h3>
<p><a href="http://gowalla.com/users/new"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/Gowalla.jpg" alt="" title="Gowalla" width="530" height="454" /></a></p>
<h3>7.Virb</h3>
<p><a href="http://virb.com/join"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/Virb.jpg" alt="" title="Virb" width="530" height="644" /></a></p>
<h3>8. Live Stream</h3>
<p><a href="https://secure.livestream.com/myaccount/login"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/Livestream.jpg" alt="" title="Livestream" width="530" height="639" /></a></p>
<h3>9. Nibble Dish</h3>
<p><a href="http://www.nibbledish.com/register"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/Nibbledish.jpg" alt="" title="Nibbledish" width="530" height="600" /></a></p>
<h3>10. Culinary Culture</h3>
<p><a href="http://www.culinaryculture.com/#signup"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/CulinaryCulture.jpg" alt="" title="CulinaryCulture" width="530" height="468" /></a></p>
<h3>11. Form one (from bundle)</h3>
<p><a href="http://cssglobe.com/post/3875/cssg-collections-web-forms"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/form1.jpg" alt="" title="form1" width="530" /></a></p>
<h3>12. Form two (from bundle)</h3>
<p><a href="http://cssglobe.com/post/3875/cssg-collections-web-forms"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/form2.jpg" alt="" title="form2" width="328" height="450" /></a></p>
<h3>13. Form three (from bundle)</h3>
<p><a href="http://cssglobe.com/post/3875/cssg-collections-web-forms"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/form3.jpg" alt="" title="form3" width="530" height="359" /></a></p>
<h3>14. Form four (from bundle)</h3>
<p><a href="http://cssglobe.com/post/3875/cssg-collections-web-forms"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/form4.jpg" alt="" title="form4" width="353" height="476" /></a></p>
<h3>15. Form five (from bundle)</h3>
<p><a href="http://cssglobe.com/post/3875/cssg-collections-web-forms"><img src="http://www.webdeveloperjuice.com/wp-content/uploads/2009/12/form5.jpg" alt="" title="form5" width="396" height="322" /></a></p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2010/09/02 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/1375.html" title="图像替换技术的最佳实战">图像替换技术的最佳实战</a> (2)</li><li>2010/04/15 -- <a href="http://cssrainbow.cn/code-snippets/css-code-snippets/1234.html" title="CSS中区别IE6, IE7和 IE8  的4个非常有用的字符">CSS中区别IE6, IE7和 IE8  的4个非常有用的字符</a> (1)</li><li>2010/03/04 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/1137.html" title="Web 设计中的 5 个最具争议性的话题">Web 设计中的 5 个最具争议性的话题</a> (0)</li><li>2010/01/29 -- <a href="http://cssrainbow.cn/tutorials/mootools/1045.html" title="表单设计与滑动的标签（Labels），基于MooTools or jQuery">表单设计与滑动的标签（Labels），基于MooTools or jQuery</a> (1)</li><li>2010/01/26 -- <a href="http://cssrainbow.cn/articles/resources/1033.html" title="网页设计中的面包屑导航：实例和最佳做法">网页设计中的面包屑导航：实例和最佳做法</a> (0)</li><li>2010/01/25 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/961.html" title="Sexy Bookmarks 效果，基于CSS">Sexy Bookmarks 效果，基于CSS</a> (0)</li><li>2010/01/14 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/882.html" title="实现侧边栏滚动的多种技术，基于CSS,jQuery or MooTools ">实现侧边栏滚动的多种技术，基于CSS,jQuery or MooTools </a> (1)</li><li>2009/11/03 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/797.html" title="征服，高级CSS选择器(收藏)">征服，高级CSS选择器(收藏)</a> (1)</li><li>2009/10/20 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/779.html" title="让XHTML/CSS页面可正常打印 (收藏)">让XHTML/CSS页面可正常打印 (收藏)</a> (0)</li><li>2009/09/21 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/734.html" title="CSS3的新功能快速体验和应用">CSS3的新功能快速体验和应用</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/articles/web-roundups/941.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Webkit浏览器中，使用CSS3替代7个JavaScript效果</title>
		<link>http://cssrainbow.cn/articles/web-roundups/932.html</link>
		<comments>http://cssrainbow.cn/articles/web-roundups/932.html#comments</comments>
		<pubDate>Sun, 24 Jan 2010 08:37:22 +0000</pubDate>
		<dc:creator>Rainbow</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Roundups]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://cssrainbow.cn/?p=932</guid>
		<description><![CDATA[众所周知，这段时间CSS3一直很火，大有成为“JavaScript杀手”的可能。此文将会介绍7个很酷的CSS3动画的示例(Accordion,Spin Block,Bounce Block,Expand Block,Expand Block,Nudge,Pulsate Block,Fade Block)，使用WebKit浏览器（如Google Chrome 和Safari）。我相信在不久的将来，有些必须用javascript librararies实现的效果完全可以用CSS3取代的 。
]]></description>
			<content:encoded><![CDATA[<p>众所周知，这段时间CSS3一直很火，大有成为“JavaScript杀手”的可能。</p>
<p>此文将会介绍7个很酷的CSS3动画的示例，使用WebKit浏览器（如Google Chrome 和Safari）。</p>
<p>我相信在不久的将来，有些必须用javascript librararies实现的效果完全可以用CSS3取代的 。 </p>
<p>我们先看一下 <a href="http://webdeveloperjuice.com/demos/css/css3effects.html" class="button">全部的Demo 演示</a>. 请尝试在最新的WebKit浏览器中浏览，如 safari 和 chrome中。</p>
<h2>效果 1: Fade Block</h2>
<p><strong>The HTML Code:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fade&quot;</span>&gt;</span>Place mouse on  me i will fade!<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p><strong>The CSS Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#fade</span><span style="color: #00AA00;">&#123;</span>opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>-webkit-transition<span style="color: #00AA00;">:</span> opacity 1s linear<span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#fade</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span>opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><span id="more-932"></span></p>
<h2>效果 2: Pulsate Block</h2>
<p><strong>The HTML Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pulsate&quot;</span>&gt;</span>Place mouse on  me i will pulsate!<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p><strong>The CSS Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#pulsate</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>-webkit-animation-name<span style="color: #00AA00;">:</span> pulsate<span style="color: #00AA00;">;</span>-webkit-animation-duration<span style="color: #00AA00;">:</span> 20s<span style="color: #00AA00;">;</span>-webkit-animation-timing-function<span style="color: #00AA00;">:</span> ease-in-out<span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
	<span style="color: #a1a100;">@-webkit-keyframes pulsate {</span>
        <span style="color: #933;"><span style="color: #cc66cc;">0</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">140px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
        <span style="color: #933;"><span style="color: #cc66cc;">5</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">190px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
        <span style="color: #933;"><span style="color: #cc66cc;">10</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">140px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span> 
        <span style="color: #933;"><span style="color: #cc66cc;">15</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">190px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
        <span style="color: #933;"><span style="color: #cc66cc;">20</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">140px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>	
        <span style="color: #933;"><span style="color: #cc66cc;">40</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">140px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
        <span style="color: #933;"><span style="color: #cc66cc;">45</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">190px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
        <span style="color: #933;"><span style="color: #cc66cc;">50</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">140px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
        <span style="color: #933;"><span style="color: #cc66cc;">55</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">190px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
        <span style="color: #933;"><span style="color: #cc66cc;">60</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">140px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
        <span style="color: #933;"><span style="color: #cc66cc;">80</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">140px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
        <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">140px</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span>
	<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h2>效果 3: Nudge</h2>
<p><strong>The HTML Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nudge&quot;</span>&gt;</span>Place mouse on  me my text will shift!<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p><strong>The CSS Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#nudge</span><span style="color: #00AA00;">&#123;</span>-webkit-transition-property<span style="color: #3333ff;">:color</span><span style="color: #00AA00;">,</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">,</span><span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">;</span>-webkit-transition-duration<span style="color: #00AA00;">:</span>500ms<span style="color: #00AA00;">,</span>500ms<span style="color: #00AA00;">,</span>500ms<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#nudge</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#efefef</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>padding-<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h2>效果 4: Expand Block</h2>
<p><strong>The HTML Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;expand&quot;</span>&gt;</span>Place mouse on  me my border will expand<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p><strong>The CSS Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#expand</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#eee</span><span style="color: #00AA00;">;</span>-webkit-transition<span style="color: #00AA00;">:</span> all 500ms linear<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#expand</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#800</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h2>效果 5: Bounce Block</h2>
<p><strong>The HTML Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bounce&quot;</span>&gt;</span>Place mouse on  me i will bounce!<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p><strong>The CSS Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#bounce</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>-webkit-animation-name<span style="color: #00AA00;">:</span>bounce<span style="color: #00AA00;">;</span>-webkit-animation-duration<span style="color: #00AA00;">:</span>1s<span style="color: #00AA00;">;</span>-webkit-animation-iteration-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">2</span><span style="color: #00AA00;">;</span>-webkit-animation-<span style="color: #000000; font-weight: bold;">direction</span><span style="color: #00AA00;">:</span>alternate<span style="color: #00AA00;">&#125;</span>
	<span style="color: #a1a100;">@-webkit-keyframes bounce{from{margin-left:0px;}</span>
		to<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">250px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
		<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h2>效果 6: Spin Block</h2>
<p><strong>The HTML Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;spin&quot;</span>&gt;</span>Place mouse on  me i will spin<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p><strong>The CSS Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#spin</span><span style="color: #00AA00;">&#123;</span>-webkit-transition<span style="color: #00AA00;">:</span> -webkit-transform 3s ease-in<span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#spin</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span>-webkit-transform<span style="color: #00AA00;">:</span>rotate<span style="color: #00AA00;">&#40;</span>360deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h2>效果 7: Accordion</h2>
<p><strong>The HTML Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;accordion&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;accordion&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#first&quot;</span>&gt;</span>This is first tab<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;first&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#second&quot;</span>&gt;</span>This is second tab<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;second&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#third&quot;</span>&gt;</span>This is third tab<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;third&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p><strong>The CSS Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.accordion</span> a<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>background-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#eee</span><span style="color: #00AA00;">;</span>text-decoration<span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.accordion</span> a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.accordion</span> div<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#222</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.accordion</span> div p<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#accordion</span> div<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>overflow<span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>-webkit-transition<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">height</span> 600ms ease<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#accordion</span> div<span style="color: #3333ff;">:target</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">110px</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>最后我们再看一下：<a href="http://webdeveloperjuice.com/demos/css/css3effects.html" class="button">全部的Demo 演示</a></p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关日志 »</h3><ul class="related_post"><li>2010/05/06 -- <a href="http://cssrainbow.cn/articles/web-roundups/1254.html" title="CSS3 和 HTML5 兼容性测试">CSS3 和 HTML5 兼容性测试</a> (3)</li><li>2010/03/22 -- <a href="http://cssrainbow.cn/code-snippets/javascript-code-snippets/1187.html" title="简单的斑马纹表格">简单的斑马纹表格</a> (2)</li><li>2010/01/18 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/901.html" title="用CSS改变选择文本的背景颜色">用CSS改变选择文本的背景颜色</a> (0)</li><li>2009/11/03 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/797.html" title="征服，高级CSS选择器(收藏)">征服，高级CSS选择器(收藏)</a> (1)</li><li>2009/09/21 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/734.html" title="CSS3的新功能快速体验和应用">CSS3的新功能快速体验和应用</a> (0)</li><li>2009/09/01 -- <a href="http://cssrainbow.cn/tutorials/xhtml-css/684.html" title="CSS 3.0 中文参考手册 &#038; CSS3系列教程">CSS 3.0 中文参考手册 &#038; CSS3系列教程</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cssrainbow.cn/articles/web-roundups/932.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
