<?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>三水清jQuery1.4</title>
	<atom:link href="http://js8.in/tag/jquery1-4/feed" rel="self" type="application/rss+xml" />
	<link>http://js8.in</link>
	<description>专注前端开发,分享Javascript/CSS/PHP等Web前端开发技巧</description>
	<lastBuildDate>Sat, 21 Apr 2012 02:50:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>关于jQuery ready()方法一些用法解释</title>
		<link>http://js8.in/603.html</link>
		<comments>http://js8.in/603.html#comments</comments>
		<pubDate>Tue, 31 Aug 2010 02:27:27 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jQuery1.4]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=603</guid>
		<description><![CDATA[本文介绍了jQuery的ready几种常用的方法，以及在使用中注意的问题，jQuery的ready方法作用相当于我们的body onload，是当页面DOM准备就绪的时候才运行的代码，最常用的就是在DOM渲染加载之前，先给document绑定ready事件，然后当页面DOM都准备好之后才运行这个事件。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F603.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版发布啦！" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F449.html&from=http%3A%2F%2Fjs8.in%2F603.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979310.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版发布啦！</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 1.4的十五大新功能实例精讲" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F454.html&from=http%3A%2F%2Fjs8.in%2F603.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979390.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4的十五大新功能实例精讲</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="25大实用的jQuery技巧和解决方案" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F507.html&from=http%3A%2F%2Fjs8.in%2F603.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10992028.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">25大实用的jQuery技巧和解决方案</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>jQuery的<strong>ready</strong>方法的是开发中经常用到的，作用相当于我们的body onload，是当页面DOM准备就绪的时候才运行的代码，最常用的就是在DOM渲染加载之前，先给document绑定ready事件，然后当页面DOM都准备好之后才运行这个事件。<br />
关于<strong>jQuery</strong>的ready有以下几种用法</p>
<h3>最常用也是最标准的ready方法</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>简写的jQuery ready()</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<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>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>这是因为<strong>jQuery</strong>的选择器第一个参数假如为空，那么默认的是<strong>document</strong><br />
<span id="more-603"></span></p>
<h3>不建议使用的ready()方法</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>handler<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>在<a target="_blank" href="http://jquery14.com/day-01/jquery-14" target="_blank">jQuery1.4发布公告</a>中提到了：在jQuery1.4中仍然保留这种方法，但是不推荐使用，并且jQuery1.3的ready会返回一个jQuery的对象，而1.4中则不会又返回</p>
<h3>解决jQuery（$）库冲突的ready方法</h3>
<p>这一种方式一般用在处理jQuery的$和别的<strong>库冲突</strong>的时候用的,可以通过<strong><code>jQuery.noConflict()</code></strong>这个方法,我们就可以直接在代码中通过jQuery来代替$来使用,但又习惯了使用$怎么办?看下面的代码:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
jQuery<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>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#ready1&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><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;">//这样我们就可以使用$了</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>后记</h3>
<p>一般在开发中<a href="http://js8.in">断桥残雪</a>是不会推荐使用jQuery的ready方法的，因为绑定ready事件之后，jQuery需要添加<strong>DOMContentLoaded</strong>监听事件，对于页面加载渲染是有一定影响的，所以建议我们在逼不得已的情况下才使用jQuery的ready。</p>
<p>在实际开发中我推荐把ready中要执行的函数放在DOM的HTML代码之后，也就是当DOM渲染过去之后再执行handler，或者把代码直接放在页面的末尾</p>
<p><div id="attachment_590" class="wp-caption aligncenter" style="width: 157px"><a target="_blank" href="http://feed.feedsky.com/r57c"><img class="size-full wp-image-590" title="断桥残雪部落格最新的订阅地址" src="http://js8.in/wp-content/uploads/2010/08/logo_147x47.gif" alt="断桥残雪部落格最新的订阅地址" width="147" height="47" /></a><p class="wp-caption-text">订阅更“健康”</p></div><br />
<span style="display:none">woshao_985140e4b71711df9e5e000c295b2b8d</span>
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/603.html" title="关于jQuery ready()方法一些用法解释">http://js8.in/603.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/283.html" title="jQuery+google weather API轻松实现天气地图（二）" rel="bookmark inlinks">jQuery+google weather API轻松实现天气地图（二）</a></li>
<li><a href="http://js8.in/703.html" title="javascript事件：获取事件对象getEvent函数" rel="bookmark inlinks">javascript事件：获取事件对象getEvent函数</a></li>
<li><a href="http://js8.in/574.html" title="只要20元，你也可以做个QQ爱墙" rel="bookmark inlinks">只要20元，你也可以做个QQ爱墙</a></li>
<li><a href="http://js8.in/445.html" title="Google AdWords免费广告费用申请下来了" rel="bookmark inlinks">Google AdWords免费广告费用申请下来了</a></li>
<li><a href="http://js8.in/72.html" title="发布一个仿QQSvr的dedecms模板" rel="bookmark inlinks">发布一个仿QQSvr的dedecms模板</a></li>
<li><a href="http://js8.in/638.html" title="再谈Iframe的问题" rel="bookmark inlinks">再谈Iframe的问题</a></li>
<li><a href="http://js8.in/438.html" title="由一篇文章的收录说说百度和谷歌" rel="bookmark inlinks">由一篇文章的收录说说百度和谷歌</a></li>
<li><a href="http://js8.in/272.html" title="普通话考试！~" rel="bookmark inlinks">普通话考试！~</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/603.html#comments">No comment</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/jquery" rel="tag">jquery</a>, <a href="http://js8.in/tag/jquery1-4" rel="tag">jQuery1.4</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F603.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版发布啦！" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F449.html&from=http%3A%2F%2Fjs8.in%2F603.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979310.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版发布啦！</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 1.4的十五大新功能实例精讲" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F454.html&from=http%3A%2F%2Fjs8.in%2F603.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979390.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4的十五大新功能实例精讲</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="25大实用的jQuery技巧和解决方案" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F507.html&from=http%3A%2F%2Fjs8.in%2F603.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10992028.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">25大实用的jQuery技巧和解决方案</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/603.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery 1.4.1 中文参考文档下载</title>
		<link>http://js8.in/469.html</link>
		<comments>http://js8.in/469.html#comments</comments>
		<pubDate>Wed, 03 Feb 2010 09:40:04 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jQuery1.4]]></category>

		<guid isPermaLink="false">http://www.js8.in/469.html</guid>
		<description><![CDATA[jQuery1.4已经发布接近一个月了，而最新的jQuery1.4.1也已经发布~今天在itFeed上发现已经出现了jQuery1.4.1的中文参考文档啦，<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="关于jQuery ready()方法一些用法解释" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F603.html&from=http%3A%2F%2Fjs8.in%2F469.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977771.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于jQuery ready()方法一些用法解释</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery Easing 动画效果扩展" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F451.html&from=http%3A%2F%2Fjs8.in%2F469.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10980499.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery Easing 动画效果扩展</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版发布啦！" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F449.html&from=http%3A%2F%2Fjs8.in%2F469.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979310.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版发布啦！</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="两个简单的jQuery幻灯片实例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F462.html&from=http%3A%2F%2Fjs8.in%2F469.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10982886.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">两个简单的jQuery幻灯片实例</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><strong>jQuery1.4</strong>已经<a href="http://js8.in/449.html" target="_blank">发布</a>接近一个月了，而最新的<strong>jQuery1.4.1</strong>也已经发布~今天在itFeed上发现已经出现了jQuery1.4.1的中文参考文档啦，迅速转载一下：</p>
<blockquote><p>新鲜出炉，更新了大量内容，应该还有一些BUG，欢迎纠错：</p>
<p><a target="_blank" href="http://code.google.com/p/jquery-api-zh-cn/downloads/list" target="_blank">http://code.google.com/p/jquery-api-zh-cn/downloads/list</a></p>
<p>本来更早出来的，结果半路又杀出1.4.1，而且发现bind、live还有ajax等方法有大量更新，所以重新翻译这三个方法，消耗了大把时间。所以今天才发出来。</p></blockquote>
<p>jQuery1.4.1中文文档在线地址：<a target="_blank" href="http://jquery-api-zh-cn.googlecode.com/svn/trunk/xml/jqueryapi.xml" target="_blank">http://jquery-api-zh-cn.googlecode.com/svn/trunk/xml/jqueryapi.xml</a><br />
继续阅读：《<a title="jQuery1.4正式版发布啦" href="http://js8.in/449.html" target="_blank">jQuery1.4正式版发布啦</a>》、《<a title="jQuery Easing动画效果扩展" href="http://js8.in/451.html" target="_blank">jQuery Easing动画效果扩展</a>》、《<a title="jQuery1.4正式版新功能及性能测试" href="http://js8.in/450.html" target="_blank">jQuery1.4正式版新功能及性能测试</a>》、《<a title="jQuery1.4十五大新功能实例精讲" href="http://js8.in/454.html" target="_blank">jQuery1.4十五大新功能实例精讲</a>》
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/469.html" title="jQuery 1.4.1 中文参考文档下载">http://js8.in/469.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/715.html" title="NotePad++安装和配置" rel="bookmark inlinks">NotePad++安装和配置</a></li>
<li><a href="http://js8.in/412.html" title="PHP生成RSS类：RSS.class.php" rel="bookmark inlinks">PHP生成RSS类：RSS.class.php</a></li>
<li><a href="http://js8.in/600.html" title="jQuery教程之鼠标事件篇" rel="bookmark inlinks">jQuery教程之鼠标事件篇</a></li>
<li><a href="http://js8.in/580.html" title="爱墙（许愿墙）程序后台添加置顶、搜索等功能" rel="bookmark inlinks">爱墙（许愿墙）程序后台添加置顶、搜索等功能</a></li>
<li><a href="http://js8.in/497.html" title="韩峰其实是个好干部" rel="bookmark inlinks">韩峰其实是个好干部</a></li>
<li><a href="http://js8.in/11.html" title="晚上玩了一个晚上~" rel="bookmark inlinks">晚上玩了一个晚上~</a></li>
<li><a href="http://js8.in/574.html" title="只要20元，你也可以做个QQ爱墙" rel="bookmark inlinks">只要20元，你也可以做个QQ爱墙</a></li>
<li><a href="http://js8.in/701.html" title="收集几个手机浏览器的User-agent" rel="bookmark inlinks">收集几个手机浏览器的User-agent</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/469.html#comments">No comment</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/jquery" rel="tag">jquery</a>, <a href="http://js8.in/tag/jquery1-4" rel="tag">jQuery1.4</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="关于jQuery ready()方法一些用法解释" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F603.html&from=http%3A%2F%2Fjs8.in%2F469.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977771.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于jQuery ready()方法一些用法解释</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery Easing 动画效果扩展" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F451.html&from=http%3A%2F%2Fjs8.in%2F469.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10980499.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery Easing 动画效果扩展</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版发布啦！" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F449.html&from=http%3A%2F%2Fjs8.in%2F469.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979310.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版发布啦！</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="两个简单的jQuery幻灯片实例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F462.html&from=http%3A%2F%2Fjs8.in%2F469.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10982886.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">两个简单的jQuery幻灯片实例</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/469.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery 1.4的十五大新功能实例精讲</title>
		<link>http://js8.in/454.html</link>
		<comments>http://js8.in/454.html#comments</comments>
		<pubDate>Mon, 18 Jan 2010 05:39:29 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jQuery1.4]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=454</guid>
		<description><![CDATA[jQuery 1.4正式版已经发布了。 jQuery1.4 包含了很多新特性，并且在功能上进行增强，性能也得到了一定的提升！本文将结合实例向您介绍jQuery1.4的一些新特性和优化增强。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery Easing 动画效果扩展" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F451.html&from=http%3A%2F%2Fjs8.in%2F454.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10980499.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery Easing 动画效果扩展</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F454.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4浏览器判断函数bug仍然存在" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F413.html&from=http%3A%2F%2Fjs8.in%2F454.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979293.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4浏览器判断函数bug仍然存在</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery选择器使用详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F416.html&from=http%3A%2F%2Fjs8.in%2F454.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977318.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery选择器使用详解</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a title="jQuery1.4 正式版发布" href="http://js8.in/449.html" target="_blank">jQuery 1.4正式版已经发布</a>了。 jQuery1.4 包含了很多新特性，并且在功能上进行增强，性能也得到了<a title="jQuery1.4 新功能测试以及性能提升" href="http://js8.in/450.html" target="_blank">一定的提升</a>！本文将结合实例向您介绍<strong>jQuery1.4</strong>的一些新特性和优化增强。<br />
你可以立刻下载jQuery 1.4试用： <a target="_blank" href="http://code.jquery.com/jquery-1.4.js" target="_blank">http://code.jquery.com/jquery-1.4.js</a>，<br />
也可以使用谷歌提供的服务：<a target="_blank" href="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" target="_blank">http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js</a></p>
<h3>1.  jQuery()创建DOM元素：支持传参设置属性</h3>
<p>之前，jQuery可以通过 attr 方法设置元素的属性，既可传属性的名和值，也可以是包含几组特定 属性名值对 的 对象。在<strong> jQuery 1.4 </strong>中，你可以把一个参数对象作为附属参数传给 jQuery 函数本身，同时创建HTML元素。</p>
<p>比方说你想要创建一个带有几个属性的锚记元素（&lt;a&gt;&lt;/a&gt;）。在1.4中，一切如此简单：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;a&gt;&lt;/a&gt;'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
 id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'foo'</span><span style="color: #339933;">,</span>
 href<span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://google.com'</span><span style="color: #339933;">,</span>
 title<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Become a Googler'</span><span style="color: #339933;">,</span>
 rel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'external'</span><span style="color: #339933;">,</span>
 text<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Go to Google!'</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>你大概也能猜到，这个锚记元素没有的 text 属性会调用 jQuery 的私有方法&#8221;.<strong>text()</strong>&#8221; ，把元素里的文字设置为“Go to Google!”<br />
<span id="more-454"></span><br />
针对这一用法，下面是更有用的实例：</p>
<blockquote>

<div class="wp_syntax"><div 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>
 id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'foo'</span><span style="color: #339933;">,</span>
 css<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
 fontWeight<span style="color: #339933;">:</span> <span style="color: #CC0000;">700</span><span style="color: #339933;">,</span>
 color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'green'</span>
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
 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>
 <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>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>

</blockquote>
<p>id 为一般属性，被直接加上了，而 css 和 click 则激发了相应的 jQuery 方法。在1.4以前，上面的代码需写成这个样子：</p>
<blockquote>

<div class="wp_syntax"><div 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: #009900;">&#41;</span>
 .<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'foo'</span><span style="color: #009900;">&#41;</span>
 .<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
 fontWeight<span style="color: #339933;">:</span> <span style="color: #CC0000;">700</span><span style="color: #339933;">,</span>
 color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'green'</span>
 <span style="color: #009900;">&#125;</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>
 <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>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>

</blockquote>
<p><a target="_blank" href="http://api.jquery.com/jQuery/" target="_blank">详细了解 jQuery()</a></p>
<h3>2. parentsUntil()、prevUntil()、nextUntil()</h3>
<p>1.4的DOM遍历工具包里又增加了3个新方法：<strong>nextUntil</strong>， <strong>prevUntil </strong>和 <strong>parentsUntil</strong>。这些方法会按照特定的方向遍历DOM，直到遇到满足指定选择符的元素为止。举例来说，现在我们有一张水果名的清单：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
	&lt;li&gt;Apple&lt;/li&gt;
	&lt;li&gt;Banana&lt;/li&gt;
	&lt;li&gt;Grape&lt;/li&gt;
	&lt;li&gt;Strawberry&lt;/li&gt;
	&lt;li&gt;Pear&lt;/li&gt;
	&lt;li&gt;Peach&lt;/li&gt;
&lt;/ul&gt;</pre></div></div>

</blockquote>
<p>我们想挑选出所有在 Apple 后，Pear 前的所有条目。代码十分简单：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul 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>
 <span style="color: #006600; font-style: italic;">// 选出的是 Banana, Grape, Strawberry</span></pre></div></div>

</blockquote>
<p>详细了解： <a target="_blank" href="http://api.jquery.com/prevUntil/" target="_blank">prevUntil</a>, <a target="_blank" href="http://api.jquery.com/nextUntil/" target="_blank">nextUntil</a>, <a target="_blank" href="http://api.jquery.com/parentsUntil/" target="_blank">parentsUntil</a></p>
<h3>3. bind()、one()支持绑定多个事件</h3>
<p>不再需要把各个事件绑定方法“链”在一起，现在你可以把它们捆成一堆，如下：</p>
<blockquote>

<div class="wp_syntax"><div 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>
 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>
 <span style="color: #006600; font-style: italic;">// do something</span>
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
 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>
 <span style="color: #006600; font-style: italic;">// do something</span>
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
 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>
 <span style="color: #006600; font-style: italic;">// do something</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

</blockquote>
<p>这一用法也适用于 &#8220;.one()&#8221;.</p>
<p>详细了解 <a target="_blank" href="http://api.jquery.com/bind/" target="_blank">.bind(…)</a></p>
<h3>4. 动画效果Easing的增强</h3>
<p>最近断桥残雪也写了一个<a title="jQuery Easing动画效果扩展" href="http://js8.in/451.html" target="_blank">jQuery Easing的文章</a>，在jQuery1.4以前版本只能为一个动画指定一种缓动效果（easing，即动画过程中的速度变化规律。jQuery 原生支持两种缓动效果，swing（默认）和linear 。要使用其他效果，你需要自己<a href="http://js8.in/451.html" target="_blank">另行下载</a>)。现在你可以为动画的各个属性参数指定不同的缓动效果：</p>
<blockquote>

<div class="wp_syntax"><div 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>
 left<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
 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>
 <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></div></div>

</blockquote>
<p><a href="http://js8.in/mywork/jquery_easing/demo.html" target="_blank">点此查看实际效果</a></p>
<p>你也可以在一个可选的动画选项对象中为 secialEasing 设置一系列名值对来完全上面的工作：</p>
<blockquote>

<div class="wp_syntax"><div 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>
 left<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
 top<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span>
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
 duration<span style="color: #339933;">:</span> <span style="color: #CC0000;">2000</span><span style="color: #339933;">,</span>
 specialEasing<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
 top<span style="color: #339933;">:</span> <span style="color: #3366CC;">'easeOutBounce'</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p><a target="_blank" href="http://api.jquery.com/animate/#per-property-easing" target="_blank">详细了解有关 Easing动画设置的内容</a></p>
<h3>5. 增强版的 live() 事件</h3>
<p>jQuery 1.4 添加了对指派 <strong>submit</strong> ， <strong>change </strong>， <strong>focus </strong>和 <strong>blur </strong>事件的支持。在jQuery中，我们利用&#8221;<strong>.live()</strong>&#8221; 方法指派事件。当你想要为多个元素注册事件处理器时，这会非常有用。而且就算满足选择符的元素是新出现的，这些事件也会继续有效（使用 .live() 比不断重复绑定要省力省心得多）。</p>
<p>不过，当心了！注册 focus 和 blur 事件时你需要用 focusin 和 focusout 作为事件名。</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'focusin'</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>
 <span style="color: #006600; font-style: italic;">// do something with this</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>6. 使用<strong>proxy()</strong>函数指定this</h3>
<p>jQuery 1.4 提供了一个全新的 <strong>proxy</strong> 函数，位于 jQuery 命名空间下。这一函数接受两个参数，一个是“作用域”（scope）或者一个方法名，另一个是某函数或者目标作用域（the intended scope）。</p>
<p>众所周知， JavaScript的 <strong>this </strong>关键字是一个很难把握的东西。有时候你并不想它代表一个元素，而想让它代表你前面创建的某个对象。</p>
<p>例如，在这里我们创建了一个 app 对象，它拥有两个属性，一个是 clickHandler 方法，一个是负责参数配置的对象。</p>
<blockquote>

<div class="wp_syntax"><div 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>
 config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
 clickMessage<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Hi!'</span>
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
 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>
 <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>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>这个 clickHandler 方法，当像 app.clickHandler() 这样调用时，app 就是其上下文，也就是说 this 关键字指向的是 app 。如果只需简单地调用，这样的写法没什么问题：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">app.<span style="color: #660066;">clickHandler</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;">// &quot;Hi!&quot; is alerted</span></pre></div></div>

</blockquote>
<p>不过如果把它当作一个事件处理器：</p>
<blockquote>

<div class="wp_syntax"><div 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><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></pre></div></div>

</blockquote>
<p>当我们点击这个锚记时，并没有达到预想的效果（没东西 alert 出来）。这是因为 jQuery （以及大部分理智的事件模型），默认地，都会把处理器的上下文指定为目标元素本身。也就是说，this 所代表正是被点击的这个链接。而我们想的是，this 应该继续代表 app 。在jQuery 1.4中，实现这一目的十分简单：</p>
<blockquote>

<div class="wp_syntax"><div 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>
 <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: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>现在点击所有锚记都会弹出“Hi!”了。</p>
<p>代理函数把你的函数包裹一圈，同时把函数内的 this 设定为你想要东西。在其他上下文应用场景，如把回调函数传给其他 jQuery 方法或插件，代理函数也能派上用场。</p>
<p>了解更多<a target="_blank" href="http://api.jquery.com/jQuery.proxy" target="_blank"> jQuery.proxy()</a></p>
<h3>7.  动画队列延迟</h3>
<p>现在，可以给动画队列加一个延迟了。虽然这个功能可以在任何队列里实现，但最常用的可能还是延迟“fx 队列”（&#8221;fx&#8221; queue，jQuery默认的动画队列）。它能让你在两个动画行为之间暂停一下，而不用牵扯到回调函数和 setTimeout 之类的东西。<strong>.delay()</strong> 的第一个参数即你需要设定的延迟毫秒数：</p>
<blockquote>

<div class="wp_syntax"><div 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;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// Slide down</span>
 .<span style="color: #660066;">delay</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// Do nothing for 200 ms</span>
 .<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: #006600; font-style: italic;">// Fade in</span></pre></div></div>

</blockquote>
<p>如果你想延迟一个除 fx 以外的队列，把队列名作为第二个参数传给 .delay() 就可以了。</p>
<p>详细了解<a target="_blank" href="http://api.jquery.com/delay" target="_blank"> .delay(…)</a></p>
<h3>8. 使用has()检测元素是否含有特定内容</h3>
<p>jQuery 1.4 让检测一个元素（或集合）是否含有（.<strong>has()</strong>）某项东西更为容易。其背后的机理和选择过滤器 :has()是一样的。这个方法会从当前集合中选出满足任意指定条件之一的元素。</p>
<blockquote>

<div class="wp_syntax"><div 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></div></div>

</blockquote>
<p>这条语句在所有DIV元素中挑出那些包含UL元素的。这种情况可能用选择过滤器 :has() 就好了，但当你要更程式化地过滤选择集时 .has() 方法就十分有用了。</p>
<p>jQuery 1.4 还在 jQuery 命名空间下新增了一个 <strong>contains </strong> 函数。这是一个比较底层的函数，接受两个 DOM 节点为参数。返回一个布尔值，指示第二个元素是否包含在第一个元素中。例如：</p>
<p>jQuery.contains(document.documentElement, document.body);  // 返回true &#8211;  确实包含在  中</p>
<p>详细了解： <a target="_blank" href="http://api.jquery.com/has/" target="_blank">.has(…)</a>, <a target="_blank" href="http://api.jquery.com/jQuery.contains/" target="_blank">jQuery.contains(…)</a></p>
<h3>9. 给元素剥皮！</h3>
<p>很早以前，jQuery 就可以用<strong> .wrap()</strong> 给元素裹一层皮。现在， jQuery 1.4 添加了 <strong>.unwrap() </strong>方法，用以剥皮。看下面的DOM结构：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div&gt;
&lt;p&gt;
Foo
&lt;/p&gt;
&lt;/div&gt;</pre></div></div>

</blockquote>
<p>来把 p 元素外面的一层皮（div）剥掉：</p>
<blockquote>

<div class="wp_syntax"><div 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></div></div>

</blockquote>
<p>DOM 变成了：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p&gt;
Foo
&lt;/p&gt;</pre></div></div>

</blockquote>
<p>总而言之，这个方法可以把任意元素的父元素移除。.</p>
<p>详细了解<a target="_blank" href="http://api.jquery.com/unwrap/" target="_blank"> .unwrap(…)</a></p>
<h3>10. 使用detach()移除元素，而不删除数据</h3>
<p>以前有一个.<strong>remove()</strong>方法，是把元素剥离后抛弃。全新的 <strong>.detach()</strong> 方法可以让你把一个元素从DOM中剥离，而不丢失数据。囊括该元素的 jQuery 对象会在操作完成后还保留这个元素。数据可以通过<strong> .data() </strong> 或者 jQuery 事件系统中的任意事件处理器传入 jQuery 对象。</p>
<p>当你需要把某个元素从DOM中移除，然后在将来某个场景中重新引入时，这个函数会很有用。元素的事件句柄和其他所有数据都会被保留。</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> foo <span style="color: #339933;">=</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#foo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #006600; font-style: italic;">// 绑定一个重要的事件处理器</span>
 foo.<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>
 <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Foo!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 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;">// 从DOM中移除</span>
 <span style="color: #006600; font-style: italic;">// … do stuff</span>
 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;">// 重新加入到DOM</span>
  foo.<span style="color: #660066;">click</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;">// 弹出alert信息： &quot;Foo!&quot;</span></pre></div></div>

</blockquote>
<p>详细了解 <a target="_blank" href="http://api.jquery.com/detach" target="_blank">.detach(…)</a></p>
<h3>11. index() 的功能增强</h3>
<p>jQuery 1.4 为您使用 <strong>.index()</strong> 提供了两种新方法。以前，你必须把元素作为参数传给它，然后获得一个返回的数值，代表在当前集合中这个元素的索引。现在，如果不传参数过去，返回的值就代表某元素在其同辈中排行老几。比方说下面的DOM：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
	&lt;li&gt;Apple&lt;/li&gt;
	&lt;li&gt;Banana&lt;/li&gt;
	&lt;li&gt;Grape&lt;/li&gt;
	&lt;li&gt;Strawberry&lt;/li&gt;
	&lt;li&gt;Pear&lt;/li&gt;
	&lt;li&gt;Peach&lt;/li&gt;
&lt;/ul&gt;</pre></div></div>

</blockquote>
<p>你想要晓得点击一个条目后它是列表中的第几个，实现的代码十分简单：</p>
<blockquote>

<div class="wp_syntax"><div 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>
 <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>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>jQuery 1.4 也允许你将选择符作为 .<strong>index()</strong> 的第一个参数。这样做会返回当前元素在你指定的选择符所匹配出的元素集合中的索引值。</p>
<p>还得提醒一点，这一方法返回的是数值，如果文档中无法找到指定条件的元素，会返回数值 -1 。</p>
<p>详细了解 <a target="_blank" href="http://api.jquery.com/index" target="_blank">.index(…)</a></p>
<h3>12. DOM 操作可接收回调函数</h3>
<p>现在，大部分的DOM操作方法都支持了将 函数 作为单一参数传入（<strong>.css()</strong> 和 <strong>.attr() </strong>传入为第二个参数）。这个函数会为选择集中的每一个元素都跑一遍，从而为相应操纵方法提供更“有个性”的值。</p>
<p>下列方法支持这一功能：</p>
<ol>
<li><a target="_blank" href="http://api.jquery.com/after" target="_blank">after()</a></li>
<li><a target="_blank" href="http://api.jquery.com/before" target="_blank">before()</a></li>
<li><a target="_blank" href="http://api.jquery.com/append" target="_blank">append()</a></li>
<li><a target="_blank" href="http://api.jquery.com/prepend" target="_blank">prepend()</a></li>
<li><a target="_blank" href="http://api.jquery.com/addClass" target="_blank">addClass()</a></li>
<li><a target="_blank" href="http://api.jquery.com/toggleClass" target="_blank">toggleClass()</a></li>
<li><a target="_blank" href="http://api.jquery.com/removeClass">removeClass()</a></li>
<li><a target="_blank" href="http://api.jquery.com/wrap" target="_blank">wrap()</a></li>
<li><a target="_blank" href="http://api.jquery.com/wrapAll" target="_blank">wrapAll()</a></li>
<li><a target="_blank" href="http://api.jquery.com/wrapInner" target="_blank">wrapInner()</a></li>
<li><a target="_blank" href="http://api.jquery.com/val" target="_blank">val()</a></li>
<li><a target="_blank" href="http://api.jquery.com/text" target="_blank">text()</a></li>
<li><a target="_blank" href="http://api.jquery.com/replaceWith" target="_blank">replaceWith()</a></li>
<li><a target="_blank" href="http://api.jquery.com/css" target="_blank">css()</a></li>
<li><a target="_blank" href="http://api.jquery.com/attr" target="_blank">attr()</a></li>
<li><a target="_blank" href="http://api.jquery.com/html" target="_blank">html()</a></li>
</ol>
<p>有了回调函数，你就能在选择集中利用 <strong>this </strong>关键字来访问当前元素，用回调函数的第一个参数来访问其索引值。</p>
<blockquote>

<div class="wp_syntax"><div 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>
 <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>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>还有还有，上面的某些方法还提供第二个参数供你利用。如果你调用的是一个设定型方法（如.html() 和 .attr(&#8217;href&#8230;) ），你还能取得当前值。例如：</p>
<blockquote>

<div class="wp_syntax"><div 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;">attr</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>i<span style="color: #339933;">,</span> currentHref<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <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>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>如您所见，对于.<strong>css() </strong>和 .<strong>attr() </strong>方法来说，之所以要把函数作为第二个参数传递，是因为第一个参数要用来指定我们需要修改的是哪一个属性：</p>
<blockquote>

<div class="wp_syntax"><div 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;">css</span><span style="color: #009900;">&#40;</span><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>i<span style="color: #339933;">,</span> currentCssColor<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">return</span> i <span style="color: #339933;">%</span> <span style="color: #CC0000;">2</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">'red'</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'blue'</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>13. 判定对象类型:isEmptyObject、isPlainObject</h3>
<p>jQuery 1.4 新增了两个全新的辅助函数（都直接位于 jQuery 命名空间下），可以帮助你判别你正在操纵的是何种对象。</p>
<p>第一个函数是 <strong>isEmptyObject</strong>, ，它返回一个布尔值，判定对象是否为空（）。第二个是<strong> isPlainObject </strong>，它返回的布尔值代表传递过去的参数是否为JavaScript的简单对象（plain object），也就是用 {} 或 new Object()创建的对象。</p>
<blockquote>

<div class="wp_syntax"><div 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>
 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;
 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>
 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>
 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></div></div>

</blockquote>
<p>了解更多：<a target="_blank" href="http://api.jquery.com/jQuery.isPlainObject" target="_blank"> isPlainObject(…)</a>, <a target="_blank" href="http://api.jquery.com/jQuery.isEmptyObject" target="_blank">isEmptyObject(…)</a></p>
<h3>14. Closest() 的功能增强</h3>
<p>jQuery的<strong>.closest() </strong>方法现在可以接受一组选择符作为参数。当你需要遍历某一元素的所有上级，找到一个以上符合特定特征的最近元素时，此功能就能派上用场。</p>
<p>而且，现在它还能接受上下文环境作为第二个参数，也就是说你可以控制DOM遍历的深度或者说远度。虽然说大家可能很少会用到这两个新特性，但一旦用上效果是惊人的！</p>
<p>了解更多 <a target="_blank" href="http://api.jquery.com/closest" target="_blank">.closest(…)</a></p>
<h3>15. 新事件： focusIn 与 focusOut</h3>
<p>如前所述，现在部署 focus 和 blur 事件时，你需要使用 focusin 和 focusout 这两个新事件。这两个事件帮助你在特定元素或者该元素的子元素 获取/失去 焦点时采取行动。</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'form'</span><span style="color: #009900;">&#41;</span>
 .<span style="color: #660066;">focusin</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>
 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;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'focused'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 .<span style="color: #660066;">focusout</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>
 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;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'focused'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>值得说明的是，这两个事件不会传播开来（即所谓的“冒泡”），它们会被捕获住。</p>
<p>了解更多关于 <a target="_blank" href="http://api.jquery.com/focusin" target="_blank">focusIn </a>和 <a target="_blank" href="http://api.jquery.com/focusout" target="_blank">focusOut </a>事件的内容。</p>
<h3>写在最后</h3>
<p>爱上 jQuery 1.4 吧！史上考虑最周到，功能最丰富，性能最好的 jQuery ！<br />
就是这样&#8230; 我已经介绍完我觉得对你最有影响的一些新特性了。<br />
如果你还不知道，那就赶快去看看 “<a target="_blank" href="http://jquery14.com/" target="_blank">14 days of jQuery</a>”活动，为庆祝 jQuery 1.4 的发布和 jQuery 四岁生日而举办的超赞的线上活动。</p>
<p>另外，别忘了看看全新的<a target="_blank" href="http://api.jquery.com/" target="_blank"> API 文档</a> ！<br />
原文作者：James Padolsey<br />
原文地址：<a target="_blank" href="http://net.tutsplus.com/tutorials/javascript-ajax/jquery-1-4-released-the-15-new-features-you-must-know/" target="_blank">http://net.tutsplus.com/tutorials/javascript-ajax/jquery-1-4-released-the-15-new-features-you-must-know/</a>
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/454.html" title="jQuery 1.4的十五大新功能实例精讲">http://js8.in/454.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/293.html" title="【续】教你偷老师的课件甚至考试试题~" rel="bookmark inlinks">【续】教你偷老师的课件甚至考试试题~</a></li>
<li><a href="http://js8.in/351.html" title="使用CSS控制打印页面格式" rel="bookmark inlinks">使用CSS控制打印页面格式</a></li>
<li><a href="http://js8.in/44.html" title="没见过这么不要脸的！——校内网太不厚道，无耻之" rel="bookmark inlinks">没见过这么不要脸的！——校内网太不厚道，无耻之</a></li>
<li><a href="http://js8.in/30.html" title="08.11.14" rel="bookmark inlinks">08.11.14</a></li>
<li><a href="http://js8.in/359.html" title="提前体验Google新页面" rel="bookmark inlinks">提前体验Google新页面</a></li>
<li><a href="http://js8.in/383.html" title="GoDaddy促销COM域名，在华仅0.99美元" rel="bookmark inlinks">GoDaddy促销COM域名，在华仅0.99美元</a></li>
<li><a href="http://js8.in/692.html" title="新浪微博应用：微博送大礼" rel="bookmark inlinks">新浪微博应用：微博送大礼</a></li>
<li><a href="http://js8.in/18.html" title="中病毒啦！是威金！" rel="bookmark inlinks">中病毒啦！是威金！</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/454.html#comments">2 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/javascript" rel="tag">javascript</a>, <a href="http://js8.in/tag/jquery" rel="tag">jquery</a>, <a href="http://js8.in/tag/jquery1-4" rel="tag">jQuery1.4</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery Easing 动画效果扩展" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F451.html&from=http%3A%2F%2Fjs8.in%2F454.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10980499.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery Easing 动画效果扩展</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F454.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4浏览器判断函数bug仍然存在" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F413.html&from=http%3A%2F%2Fjs8.in%2F454.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979293.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4浏览器判断函数bug仍然存在</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery选择器使用详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F416.html&from=http%3A%2F%2Fjs8.in%2F454.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977318.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery选择器使用详解</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/454.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery Easing 动画效果扩展</title>
		<link>http://js8.in/451.html</link>
		<comments>http://js8.in/451.html#comments</comments>
		<pubDate>Sat, 16 Jan 2010 02:21:10 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jQuery1.4]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=451</guid>
		<description><![CDATA[最近断桥残雪部落格的首页文章添加了“点击展开/关闭”文章功能，并且返回顶部、跳到评论等功能进行了动画效果的修改，此次修改使用了jQuery Easing动画效果扩展插件：jQuery Easing Plugin。在jQuery文档中我们可以看到，自定义动画函数.animate()有四个参数<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F451.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版新功能及性能测试" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F450.html&from=http%3A%2F%2Fjs8.in%2F451.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026546.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版新功能及性能测试</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 1.4的十五大新功能实例精讲" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F454.html&from=http%3A%2F%2Fjs8.in%2F451.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979390.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4的十五大新功能实例精讲</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版发布啦！" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F449.html&from=http%3A%2F%2Fjs8.in%2F451.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979310.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版发布啦！</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近<strong>断桥残雪部落格</strong>的<a target="_blank" title="断桥残雪部落格首页" href="http://js8.in" target="_blank">首页</a>文章添加了“点击展开/关闭”文章功能，并且返回顶部、跳到评论等功能进行了动画效果的修改，此次修改使用了jQuery Easing动画效果扩展插件：<a title="jQuery Easing动画效果插件" href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank" rel="external nofollow">jQuery Easing Plugin</a>。在jQuery文档中我们可以看到，自定义动画函数<strong>.animate()</strong>有四个参数：</p>
<blockquote><p style="text-indent:0"><strong>params </strong>(Options) : 一组包含作为动画属性和终值的样式属性和及其值的集合<br />
<strong> duration</strong> (String,Number) : (可选) 三种预定速度之一的字符串(&#8221;slow&#8221;, &#8220;normal&#8221;, or &#8220;fast&#8221;)或表示动画时长的毫秒数值(如：1000)<br />
<strong> easing</strong> (String) : (可选) 要使用的擦除效果的名称(需要插件支持).默认jQuery提供&#8221;linear&#8221; 和 &#8220;swing&#8221;.<br />
<strong> callback</strong> (Function) : (可选) 在动画完成时执行的函数</p>
</blockquote>
<p>其中参数<strong>easing</strong>默认有两个效果：“linear”和“swing”，如果需要更多就要插件支持了，也就是今天断桥残雪要跟大家分享的插件：<a target="_blank" title="jQuery Easing动画效果插件" href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank" rel="external nofollow">jQuery Easing Plugin</a>.</p>
<p>在jQuery Easing中设置了easeInElastic、easeOutElastic、easeInOutElastic等共31中不同的效果，应该可以满足大家的需要啦，如果你还想研究下动画移动的效果图，还可以看一下<a target="_blank" href="http://james.padolsey.com/demos/jquery/easing/" target="_blank" rel="external nofollow">这篇文章</a>不仅有动画演示，还有图片分析。<span id="more-451"></span></p>
<h3>引入Easing js文件</h3>
<p>要使用jQuery Easing扩展，首先我们要在jQuery之后，引入jQuery Easing Plugin文件，如以下代码</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://js8.in/mywork/jquery_easing/easing.js&quot;&gt;
&lt;/script&gt;</pre></div></div>

</blockquote>
<h3>jQuery Easing简单教程</h3>
<p><strong>方法1</strong>、设置jQuery默认动画效果</p>
<p>jQuery.easing.def = &#8220;method&#8221;;//如：easeOutExpo</p>
<p><strong>方法2</strong>、jQuery默认动画</p>
<p>支持toggle()、slideUp()、slideDown()、show()、hide()等jQuery内置的动画效果</p>
<p>如以下代码：<br />
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	duration<span style="color: #339933;">:</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span> 
	easing<span style="color: #339933;">:</span> method<span style="color: #339933;">,</span> 
	complete<span style="color: #339933;">:</span> callback<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p><strong>方法3</strong>、使用jQuery自定义动画函数<strong>.animate()</strong></p>
<p>jQuery 的<strong>.animate()</strong>是自定义动画的函数，如上面所说，有四个参数，而其中<strong>easing</strong>的参数就是我们进行动画效果扩展的方法名称（如easeOutExpo）。最简单的使用方法是：<br />
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>myElement<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    left<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
    top<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'easeOutExpo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>上面的代码就是实现的动画之后以easeOutExpo的方法来进行缓冲（easing），这是animate() easing的基本用法（<a href="http://js8.in/mywork/jquery_easing/demo.html" target="_blank">点击查看此效果演示DEMO</a>）</p>
<p><a target="_blank" href="http://james.padolsey.com" target="_blank" rel="external nofollow">James Padolsey</a>对jQuery1.3.2的<strong>animate</strong>函数进行了修改扩展：<br />
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">fn</span>.<span style="color: #660066;">animate</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>_anim<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> jQEasing <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">easing</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>prop<span style="color: #339933;">,</span> duration<span style="color: #339933;">,</span> easing<span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> props <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> optall<span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> hasEaser <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span> i <span style="color: #000066; font-weight: bold;">in</span> prop <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> jQuery.<span style="color: #660066;">isArray</span><span style="color: #009900;">&#40;</span>prop<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                hasEaser <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                props<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> prop<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                prop<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> prop<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        opt <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">speed</span><span style="color: #009900;">&#40;</span>duration<span style="color: #339933;">,</span> easing<span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>hasEaser<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            opt.<span style="color: #660066;">step</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>_step<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>now<span style="color: #339933;">,</span> fx<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #003366; font-weight: bold;">var</span> end <span style="color: #339933;">=</span> fx.<span style="color: #660066;">end</span><span style="color: #339933;">,</span> easeFn<span style="color: #339933;">;</span>
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> easeFn <span style="color: #339933;">=</span> props<span style="color: #009900;">&#91;</span>fx.<span style="color: #660066;">prop</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        fx.<span style="color: #660066;">now</span> <span style="color: #339933;">=</span> jQEasing<span style="color: #009900;">&#91;</span>easeFn<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span> now<span style="color: #339933;">/</span>end<span style="color: #339933;">,</span> now<span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> end<span style="color: #339933;">,</span> end <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                    _step <span style="color: #339933;">&amp;&amp;</span> _step.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span> fx.<span style="color: #660066;">elem</span><span style="color: #339933;">,</span> fx.<span style="color: #660066;">now</span><span style="color: #339933;">,</span> fx <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>opt.<span style="color: #660066;">step</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        opt.<span style="color: #660066;">complete</span> <span style="color: #339933;">=</span> opt.<span style="color: #660066;">old</span> <span style="color: #339933;">||</span> callback <span style="color: #339933;">||</span> jQuery.<span style="color: #660066;">isFunction</span><span style="color: #009900;">&#40;</span>easing<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> easing<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> _anim.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> prop<span style="color: #339933;">,</span> opt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery.<span style="color: #660066;">fn</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>在<strong>jQuery1.4</strong>中这种方式已经<a target="_blank" href="http://github.com/jquery/jquery/commit/93fdbeb963a9c350f807818c7cc99982942a92f3" target="_blank">被引入</a>，所以jQuery1.4中不需要添加jQuery的<strong>animate()</strong>扩展，我们就可以使用下面的更加方便代码啦：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>myElement<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    left<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
    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> 
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'swing'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>上面的代码的效果是，总体上来使用swing的方法来缓冲，而top的时候采用easeOutBounce的方法来缓冲。（<a href="http://js8.in/mywork/jquery_easing/demo2.html" target="_blank">点击查看此效果演示DEMO</a>）</p>
<h3>jQuery1.4 的animate()+Easing</h3>
<p>值得一提的是<a target="_blank" title="jQuery1.4正式版发布" href="http://js8.in/449.html" target="_blank">jQuery 1.4版本</a>中对animate()方法，easing的方法进行了扩展，英语不错的童鞋，可以<a href="http://james.padolsey.com/javascript/easing-in-jquery-1-4a2/" target="_blank">点击此处</a></p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span>myElement<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    left<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;">'swing'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
    top<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'easeOutBounce'</span><span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>或者：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span>myElement<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    left<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
    top<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
    specialEasing<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        left<span style="color: #339933;">:</span> <span style="color: #3366CC;">'swing'</span><span style="color: #339933;">,</span>
        top<span style="color: #339933;">:</span> <span style="color: #3366CC;">'easeOutBounce'</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>有了上面的Easing扩展效果，已经能够满足了我们日常的动画要求了，<strong>jQuery1.4正式版</strong>也已经发布，添加了很多新的方法函数，但是很多新方法的研究还没有跟入，期待jQuery1.4的新中文文档！
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/451.html" title="jQuery Easing 动画效果扩展">http://js8.in/451.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/390.html" title="jQuery1.4 Alpha 2发布" rel="bookmark inlinks">jQuery1.4 Alpha 2发布</a></li>
<li><a href="http://js8.in/630.html" title="我开发的新浪微博应用：微博送祝福" rel="bookmark inlinks">我开发的新浪微博应用：微博送祝福</a></li>
<li><a href="http://js8.in/701.html" title="收集几个手机浏览器的User-agent" rel="bookmark inlinks">收集几个手机浏览器的User-agent</a></li>
<li><a href="http://js8.in/46.html" title="如何写网站的robots.txt和meta name robots的配置" rel="bookmark inlinks">如何写网站的robots.txt和meta name robots的配置</a></li>
<li><a href="http://js8.in/67.html" title="校内人人网忽悠用户-陈一舟牛啊~" rel="bookmark inlinks">校内人人网忽悠用户-陈一舟牛啊~</a></li>
<li><a href="http://js8.in/554.html" title="引入CSS 的两种方式：link和@import的区别" rel="bookmark inlinks">引入CSS 的两种方式：link和@import的区别</a></li>
<li><a href="http://js8.in/625.html" title="css解决chrome 12px字号限制" rel="bookmark inlinks">css解决chrome 12px字号限制</a></li>
<li><a href="http://js8.in/383.html" title="GoDaddy促销COM域名，在华仅0.99美元" rel="bookmark inlinks">GoDaddy促销COM域名，在华仅0.99美元</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/451.html#comments">3 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/jquery" rel="tag">jquery</a>, <a href="http://js8.in/tag/jquery1-4" rel="tag">jQuery1.4</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F451.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版新功能及性能测试" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F450.html&from=http%3A%2F%2Fjs8.in%2F451.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026546.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版新功能及性能测试</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 1.4的十五大新功能实例精讲" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F454.html&from=http%3A%2F%2Fjs8.in%2F451.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979390.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4的十五大新功能实例精讲</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版发布啦！" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F449.html&from=http%3A%2F%2Fjs8.in%2F451.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979310.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版发布啦！</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/451.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQuery1.4正式版新功能及性能测试</title>
		<link>http://js8.in/450.html</link>
		<comments>http://js8.in/450.html#comments</comments>
		<pubDate>Fri, 15 Jan 2010 03:57:47 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery1.4]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=450</guid>
		<description><![CDATA[jQuery1.4正式版已经发布，今天来看看官方给我们的jQuery1.4的新功能以及性能测试分析。使用内部函数调用，以减少对代码库的复杂性，使jQuery1.4的性能相对于1.3.2得到了大幅的提升<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F450.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版发布啦！" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F449.html&from=http%3A%2F%2Fjs8.in%2F450.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979310.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版发布啦！</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="关于jQuery ready()方法一些用法解释" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F603.html&from=http%3A%2F%2Fjs8.in%2F450.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977771.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于jQuery ready()方法一些用法解释</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery Easing 动画效果扩展" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F451.html&from=http%3A%2F%2Fjs8.in%2F450.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10980499.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery Easing 动画效果扩展</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a title="jQuery1.4正式版发布" href="http://js8.in/449.html" target="_blank">jQuery1.4正式版已经发布</a>，今天来看看官方给我们的<strong>jQuery1.4</strong>的新功能以及性能测试分析。</p>
<h3>对于jQuery常用的函数进行了大幅的性能提升</h3>
<p>使用内部函数调用，以减少对代码库的复杂性，使jQuery1.4的性能相对于1.3.2得到了大幅的提升</p>
<p><a href="http://js8.in/wp-content/uploads/2010/01/4271690739_f0bced3a78.jpg"><img src="http://js8.in/wp-content/uploads/2010/01/4271690739_f0bced3a78.jpg" alt="4271690739_f0bced3a78" title="4271690739_f0bced3a78" width="500" height="375" class="alignnone size-full wp-image-452" /></a><br />
<span id="more-450"></span></p>
<h3>方便的设置函数</h3>
<p><strong>jQuery1.4</strong>给很多函数加上了设置方法，可以运行一定的代码。如大家常用的以下函数：</p>
<blockquote><p>. attr()，.css(), .attr(), .val(), .html(), .text(), .append(), .prepend(), .before(), .after(), .replaceWith(), .wrap(), .wrapInner(), .offset(), .addClass(), .removeClass(), and .toggleClass()。</p></blockquote>
<p>以下函数可以在第二个参数变量中添加一个function的参数：</p>
<blockquote><p>.css(), .attr(), .val(), .html(), .text(), .append(), .prepend(), .offset(), .addClass(), .removeClass(), and .toggleClass().</p></blockquote>
<p>如以下代码：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// find all ampersands in A's and wrap with a span</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</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: #339933;">,</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: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/&amp;amp;/gi</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'&lt;span class=&quot;amp&quot;&gt;&amp;amp;&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Add some information to the title of the anchors</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a[target]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;title&quot;</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: #339933;">,</span>title<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">return</span> title <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; (Opens in External Window)&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>属性方法的性能以及功能的全面提升</h3>
<p>1.、.css() 和 .attr() 性能得到了提升<br />
<img src="http://farm5.static.flickr.com/4026/4271691147_fd72853fa4.jpg" alt="jquery1.4对.css .attr方法的性能提升" /><br />
2、 .attr()可以添加一个为function的参数变量</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;img src=&quot;enter.png&quot; alt=&quot;enter your name&quot; /&gt;'</span><span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;alt&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>index<span style="color: #339933;">,</span> value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;Please, &quot;</span> <span style="color: #339933;">+</span> value<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>3、.val( Function )</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;input class=&quot;food&quot; type='text' data-index=&quot;0&quot; /&gt;
&lt;input class=&quot;food&quot; type='text' data-index=&quot;1&quot; /&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input:text.food&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&amp;lt;ul class='sortable'&gt;&lt;li&gt;Peanut Butter&amp;lt;/li&gt;&amp;lt;li&gt;Jelly&amp;lt;/li&gt;&amp;lt;/ul&gt;&quot;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">sortable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;endsort&quot;</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>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:text.food&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</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>
      <span style="color: #000066; font-weight: bold;">return</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul.sortable li:eq(&quot;</span> <span style="color: #339933;">+</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;data-index&quot;</span><span style="color: #009900;">&#41;</span>  <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>快速创建dom元素</h3>
<p>现在在jQuery1.4中你可以给创建的dom元素用object的方式，同时添加事件绑定、设置css属性等，如：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div/&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
    id<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;foo&quot;</span><span style="color: #339933;">,</span>
    css<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;50px&quot;</span><span style="color: #339933;">,</span>
        width<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;50px&quot;</span><span style="color: #339933;">,</span>
        color<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;blue&quot;</span><span style="color: #339933;">,</span>
        backgroundColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;#ccc&quot;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    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>
       $<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;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;backgroundColor&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;red&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>.eq(-N), .get(-N)支持从后面往前选择</h3>
<p>如果你想选择倒数第二个节点可以使用下面的代码：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>新的方法： jQuery.proxy() </h3>
<p>现在我们可以通过设置jQuery.proxy() 来使用<strong>this</strong>指针，如：</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> obj <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;John&quot;</span><span style="color: #339933;">,</span>
  test<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>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#test&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unbind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> obj.<span style="color: #660066;">test</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#test&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span> jQuery.<span style="color: #660066;">proxy</span><span style="color: #009900;">&#40;</span> obj<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;test&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>.bind()函数支持多个事件同时绑定</h3>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div.test&quot;</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>
  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>
    $<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;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;active&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  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>
    $<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;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;inside&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  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>
    $<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;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;inside&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>新的事件监控方法`focusin`和`focusout`</h3>
<p>jQuery1.4新增加了`focusin`和`focusout’两个事件的监听</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">focusout</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> tgt <span style="color: #339933;">=</span> event.<span style="color: #660066;">target</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tgt.<span style="color: #660066;">nodeName</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;INPUT&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>tgt.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span>tgt<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;span&gt;nothing here&lt;/span&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>新方法：.detach()</h3>
<p>.detach()删除一个DOM元素，但是不删除DOM的元素事件。如：</p>
<blockquote>

<div class="wp_syntax"><div 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;">&quot;#foo&quot;</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>
    <span style="color: #006600; font-style: italic;">// do something</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
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;">// foo retains event handlers</span>
foo.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<h3>新方法：unwrap()</h3>
<p>.unwrap()可以把子节点替换掉父节点，如：</p>
<blockquote><p>
处理前html：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;body&gt;
    &lt;div&gt;
        &lt;p&gt;annie&lt;/p&gt; &lt;p&gt;davey&lt;/p&gt; &lt;p&gt;stevie&lt;/p&gt;
    &lt;/div&gt;
&lt;/body&gt;</pre></div></div>

<p>处理js：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</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></div></div>

<p>处理后的html：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;body&gt;
   &lt;p&gt;annie&lt;/p&gt; &lt;p&gt;davey&lt;/p&gt; &lt;p&gt;stevie&lt;/p&gt;
&lt;/body&gt;</pre></div></div>

</blockquote>
<p>另外jQuery1.4在Ajax、<strong>选择器</strong>等在性能方面都有了很大的提升，还添加了几个新的方法。
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/450.html" title="jQuery1.4正式版新功能及性能测试">http://js8.in/450.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/249.html" title="懂爱" rel="bookmark inlinks">懂爱</a></li>
<li><a href="http://js8.in/481.html" title="瑞星贿赂造假丑闻曝光，为转移视线捏造360后门事件" rel="bookmark inlinks">瑞星贿赂造假丑闻曝光，为转移视线捏造360后门事件</a></li>
<li><a href="http://js8.in/373.html" title="推荐六个在线制作Loading图标的网站" rel="bookmark inlinks">推荐六个在线制作Loading图标的网站</a></li>
<li><a href="http://js8.in/38.html" title="Ajax文章评论上线！" rel="bookmark inlinks">Ajax文章评论上线！</a></li>
<li><a href="http://js8.in/764.html" title="nodejs教程：配置nodejs.exe的windows目录结构" rel="bookmark inlinks">nodejs教程：配置nodejs.exe的windows目录结构</a></li>
<li><a href="http://js8.in/639.html" title="企业黄页网站GongSiHuangYe.COM上线" rel="bookmark inlinks">企业黄页网站GongSiHuangYe.COM上线</a></li>
<li><a href="http://js8.in/49.html" title="Dedecms技巧—屏蔽禁用词语，垃圾留言过滤功能" rel="bookmark inlinks">Dedecms技巧—屏蔽禁用词语，垃圾留言过滤功能</a></li>
<li><a href="http://js8.in/17.html" title="windows Xp和office盗版软件避免十月20号之后出现黑屏方法" rel="bookmark inlinks">windows Xp和office盗版软件避免十月20号之后出现黑屏方法</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/450.html#comments">4 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/jquery1-4" rel="tag">jQuery1.4</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F450.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版发布啦！" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F449.html&from=http%3A%2F%2Fjs8.in%2F450.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979310.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版发布啦！</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="关于jQuery ready()方法一些用法解释" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F603.html&from=http%3A%2F%2Fjs8.in%2F450.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977771.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于jQuery ready()方法一些用法解释</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery Easing 动画效果扩展" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F451.html&from=http%3A%2F%2Fjs8.in%2F450.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10980499.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery Easing 动画效果扩展</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/450.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery1.4正式版发布啦！</title>
		<link>http://js8.in/449.html</link>
		<comments>http://js8.in/449.html#comments</comments>
		<pubDate>Fri, 15 Jan 2010 03:04:16 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[jQuery1.4]]></category>

		<guid isPermaLink="false">http://www.js8.in/449.html</guid>
		<description><![CDATA[最近可谓大新闻不断，百度被黑，Google退出中国把中国的互联网搞得沸沸扬扬。对于jQuery发烧友来说，jQuery1.4的发布也是一个大新闻！在jQuery的4岁生日之时，jQuery开发团队很高兴地发布最新的jQuery1.4版本！其他的代码演示、测试、文档的更新也会陆续进行更新发布。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery 1.4的十五大新功能实例精讲" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F454.html&from=http%3A%2F%2Fjs8.in%2F449.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979390.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4的十五大新功能实例精讲</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F449.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版新功能及性能测试" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F450.html&from=http%3A%2F%2Fjs8.in%2F449.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026546.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版新功能及性能测试</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="关于jQuery ready()方法一些用法解释" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F603.html&from=http%3A%2F%2Fjs8.in%2F449.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977771.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于jQuery ready()方法一些用法解释</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近可谓大新闻不断，<strong>百度被黑</strong>，<a target="_blank" title="谷歌要退出中国大陆市场？！" href="http://js8.in/446.html" target="_blank">Google退出中国</a>把中国的互联网搞得沸沸扬扬。对于jQuery发烧友来说，<a title="jQuery1.4 发布" href="http://jquery14.com/day-01/jquery-14" target="_blank">jQuery1.4的发布</a>也是一个大新闻！下面是来自于jQuery的官方网站翻译（英语高手请勿拍砖！）：</p>
<blockquote><p>在jQuery的4岁生日之时，jQuery开发团队很高兴地发布最新的jQuery1.4版本！其他的代码演示、测试、文档的更新也会陆续进行更新发布。</p></blockquote>
<h3>下载地址</h3>
<p><a target="_blank" title="jquery1.4压缩版" href="http://code.jquery.com/jquery-1.4.min.js" target="_blank">jQuery Minified</a> (23kb Gzipped)<br />
<a target="_blank" title="jquery1.4未压缩版" href="http://code.jquery.com/jquery-1.4.js" target="_blank"> jQuery Regular</a> (154kb)<br />
此外，谷歌已经提供了jQuery1.4副本，jquery团队上传到了Google服务器托管服务中。这<strong>jQuery1.4</strong>的版本是自动minified和gzip 的，地址为：<br />
<a target="_blank" href="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js">http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js</a></p>
<h3>jquery1.4特点</h3>
<p>jquery1.4所有的变化和功能添加到<a target="_blank" title="jQuery1.4参考文档" href="http://api.jquery.com/category/version/1.4/" target="_blank">jQuery1.4文档</a>中。
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/449.html" title="jQuery1.4正式版发布啦！">http://js8.in/449.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/638.html" title="再谈Iframe的问题" rel="bookmark inlinks">再谈Iframe的问题</a></li>
<li><a href="http://js8.in/983.html" title="addEventListener第二个参数的handleEvent" rel="bookmark inlinks">addEventListener第二个参数的handleEvent</a></li>
<li><a href="http://js8.in/481.html" title="瑞星贿赂造假丑闻曝光，为转移视线捏造360后门事件" rel="bookmark inlinks">瑞星贿赂造假丑闻曝光，为转移视线捏造360后门事件</a></li>
<li><a href="http://js8.in/788.html" title="在Express和Socket.IO中使用session" rel="bookmark inlinks">在Express和Socket.IO中使用session</a></li>
<li><a href="http://js8.in/54.html" title="终于搞明白yu.js的使用方法啦~" rel="bookmark inlinks">终于搞明白yu.js的使用方法啦~</a></li>
<li><a href="http://js8.in/529.html" title="通过javascript实现整站黑白效果" rel="bookmark inlinks">通过javascript实现整站黑白效果</a></li>
<li><a href="http://js8.in/72.html" title="发布一个仿QQSvr的dedecms模板" rel="bookmark inlinks">发布一个仿QQSvr的dedecms模板</a></li>
<li><a href="http://js8.in/745.html" title="javascript的词法作用域" rel="bookmark inlinks">javascript的词法作用域</a></li>
</ul>
<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://js8.in";
        var wumiiEnableCustomPos = false;
        var wumiiParams = "&#038;num=4&#038;mode=3&#038;displayInFeed=1&#038;version=1.0.5.5&#038;pf=WordPress2.8.6";
    //--></script></p>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/449.html#comments">3 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/jquery1-4" rel="tag">jQuery1.4</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery 1.4的十五大新功能实例精讲" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F454.html&from=http%3A%2F%2Fjs8.in%2F449.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10979390.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4的十五大新功能实例精讲</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 1.4.1 中文参考文档下载" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F469.html&from=http%3A%2F%2Fjs8.in%2F449.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026351.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 1.4.1 中文参考文档下载</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery1.4正式版新功能及性能测试" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F450.html&from=http%3A%2F%2Fjs8.in%2F449.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026546.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery1.4正式版新功能及性能测试</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="关于jQuery ready()方法一些用法解释" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F603.html&from=http%3A%2F%2Fjs8.in%2F449.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10977771.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于jQuery ready()方法一些用法解释</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/449.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

