<?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>CrossYou&#039;Blog &#187; JQuery</title>
	<atom:link href="http://www.crossyou.cn/tag/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://www.crossyou.cn</link>
	<description>弱水三千，只取一瓢</description>
	<lastBuildDate>Fri, 13 Jan 2012 06:39:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jQuery代码实现Web页内锚点scoll效果</title>
		<link>http://www.crossyou.cn/jquery-web-page-anchor-scoll-show.htm</link>
		<comments>http://www.crossyou.cn/jquery-web-page-anchor-scoll-show.htm#comments</comments>
		<pubDate>Fri, 04 Jun 2010 09:55:52 +0000</pubDate>
		<dc:creator>CrossYou</dc:creator>
				<category><![CDATA[Web前端]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.crossyou.cn/?p=71</guid>
		<description><![CDATA[方法原作者：http://www.learningjquery.com //页内锚点滑动效果,来自http://www.learningjquery.com/的方法 $('a[href*=#]').click(function() {     if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')     &#38;&#38; location.hostname == this.hostname){ var $target = $(this.hash); $target = $target.length &#38;&#38; $target&#124;&#124; $('[name=' + this.hash.slice(1) +']'); if ($target.length) {             var targetOffset = $target.offset().top;             $('html,body').animate({scrollTop: targetOffset}, 1000);             //return false; //使其呈现清晰的URL链接             } } }); 发现网上这段代码被各个站粘贴，以致我也不太清楚原作是谁了，我还是比较相信国外的那些大牛，不过这段代码确实值得转帖分享，在本小站再次分享。 相关文章JQuery返回顶部 代码 (wordpress)JQuery插件开发]]></description>
			<content:encoded><![CDATA[<p>方法原作者：<a href="http://www.learningjquery.com">http://www.learningjquery.com</a></p>
<pre class="php" name="code">
//页内锚点滑动效果,来自http://www.learningjquery.com/的方法
$('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    &amp;&amp; location.hostname == this.hostname){
	var $target = $(this.hash);
	$target = $target.length &amp;&amp; $target|| $('[name=' + this.hash.slice(1) +']');
	if ($target.length) {
            var targetOffset = $target.offset().top;
            $('html,body').animate({scrollTop: targetOffset}, 1000);
            //return false; //使其呈现清晰的URL链接
            }
	}
});</pre>
<p>发现网上这段代码被各个站粘贴，以致我也不太清楚原作是谁了，我还是比较相信国外的那些大牛，不过这段代码确实值得转帖分享，在本小站再次分享。</p>
<h4  class="related_post_title">相关文章</h4><ul class="related_post"><li><a href="http://www.crossyou.cn/jquery-return-top-code.htm" title="JQuery返回顶部 代码 (wordpress)">JQuery返回顶部 代码 (wordpress)</a></li><li><a href="http://www.crossyou.cn/jquery-plugin-development.htm" title="JQuery插件开发">JQuery插件开发</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.crossyou.cn/jquery-web-page-anchor-scoll-show.htm/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>JQuery返回顶部 代码 (wordpress)</title>
		<link>http://www.crossyou.cn/jquery-return-top-code.htm</link>
		<comments>http://www.crossyou.cn/jquery-return-top-code.htm#comments</comments>
		<pubDate>Sat, 01 May 2010 06:10:20 +0000</pubDate>
		<dc:creator>CrossYou</dc:creator>
				<category><![CDATA[Web前端]]></category>
		<category><![CDATA[个人生活]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[工作]]></category>
		<category><![CDATA[未来]]></category>
		<category><![CDATA[生活]]></category>

		<guid isPermaLink="false">http://www.crossyou.cn/?p=42</guid>
		<description><![CDATA[开始折腾JQuery！——2010.5.1 以前在网页中使用JavaScript的时候，总感觉这种脚本代码，除了页面提示，貌似就没啥功能了，用了反而会让页面显得很乱。 去年知道JQuery，很好很强大的一个小型的JS库，不过一直没怎么研究过，为了能让自己的博客多一些JS效果，今天开始折腾JQuery。 在网上我看到主要流行两种 返回顶部 的JS代码，一种是使用JQuery实现(匀速滑动到顶部)，一种是不使用JQuery实现(匀加速滑动到顶部)。 今天只记录如何使用JQuery来实现这个效果。 在主题header.php加一下代码： 在主题footer.php中保证有如下一段代码： &#60;a href=”#” id=”returnTop”&#62;Top&#38;uArr;&#60;/a&#62; 在主题文件夹下新建js文件夹在js文件夹下新建scrollTop.js文件，并添加如下代码： $(function(){ $('#returnTop').click(function(){ $('html,body').animate({scrollTop: '100px'}, 800); return false; }); })() 返回博客首页刷新，点击 页脚 下的 top按钮，即可看到效果了。 PS：有关 animate 使用方法，请查阅Jquery手册。 相关文章故事还没开始，便要结束了！但是我不爱相忘于江湖小小的太阳自学吉他给博客新增了几个小功能]]></description>
			<content:encoded><![CDATA[<p>开始折腾JQuery！——2010.5.1</p>
<p>以前在网页中使用JavaScript的时候，总感觉这种脚本代码，除了页面提示，貌似就没啥功能了，用了反而会让页面显得很乱。</p>
<p>去年知道JQuery，很好很强大的一个小型的JS库，不过一直没怎么研究过，为了能让自己的博客多一些JS效果，今天开始折腾JQuery。</p>
<p><span id="more-32"></span></p>
<p>在网上我看到主要流行两种 返回顶部 的JS代码，一种是使用JQuery实现(匀速滑动到顶部)，一种是不使用JQuery实现(匀加速滑动到顶部)。</p>
<p>今天只记录如何使用JQuery来实现这个效果。</p>
<p>在主题header.php加一下代码：</p>
<pre class="html" name="code">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/scrollTop.js"></script>
</pre>
<p>在主题footer.php中保证有如下一段代码：</p>
<p>&lt;a href=”#” id=”returnTop”&gt;Top&amp;uArr;&lt;/a&gt;</p>
<p>在主题文件夹下新建js文件夹在js文件夹下新建scrollTop.js文件，并添加如下代码：</p>
<pre class="javascript" name="code">
$(function(){
	$('#returnTop').click(function(){
		$('html,body').animate({scrollTop: '100px'}, 800);
		return false;
	});
})()
</pre>
<p>返回博客首页刷新，点击 页脚 下的 top按钮，即可看到效果了。</p>
<p>PS：有关 <span style="color: #008000;">animate </span>使用方法，请查阅<a title="JQuery手册" rel="nofollow" href="http://jquery-api-zh-cn.googlecode.com/svn/trunk/index.html" target="_blank">Jquery手册</a>。</p>
<h4  class="related_post_title">相关文章</h4><ul class="related_post"><li><a href="http://www.crossyou.cn/the-story-does-not-start-will-have-to-end.htm" title="故事还没开始，便要结束了！">故事还没开始，便要结束了！</a></li><li><a href="http://www.crossyou.cn/but-i-do-not-love.htm" title="但是我不爱">但是我不爱</a></li><li><a href="http://www.crossyou.cn/forget-themselves-in-the-rivers-and-lakes.htm" title="相忘于江湖">相忘于江湖</a></li><li><a href="http://www.crossyou.cn/a-little-sun.htm" title="小小的太阳">小小的太阳</a></li><li><a href="http://www.crossyou.cn/self-learning-guitar.htm" title="自学吉他">自学吉他</a></li><li><a href="http://www.crossyou.cn/add-small-function-to-blog.htm" title="给博客新增了几个小功能">给博客新增了几个小功能</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.crossyou.cn/jquery-return-top-code.htm/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>JQuery插件开发</title>
		<link>http://www.crossyou.cn/jquery-plugin-development.htm</link>
		<comments>http://www.crossyou.cn/jquery-plugin-development.htm#comments</comments>
		<pubDate>Tue, 27 Apr 2010 13:43:59 +0000</pubDate>
		<dc:creator>CrossYou</dc:creator>
				<category><![CDATA[Web前端]]></category>
		<category><![CDATA[个人生活]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[开发]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.crossyou.cn/?p=34</guid>
		<description><![CDATA[本文并非原创，主要内容来自以下链接： http://www.javaeye.com/topic/545971 http://www.learningjquery.com/2007/10/a-plugin-development-pattern 今天中午在网上看到一个不错的AD轮播的Demo，因为有提供下载于是下载下来，然后仔细看了下源代码，看到它扩展插件的方法很不错，他的格式是这样的： (function($) { $.fn.pluginName = function() { // Our plugin implementation code goes here. }; })(jQuery); 在参阅以上文章后才差不多了解了这种扩展方式，正如文中所说，这种方法对象级别的插件扩展，而上面定义了一个jQuery函数,形参是$，函数定义完成之后,把jQuery这个实参传递进去.立即调用执行。这样的好处是,我们在写jQuery插件时,也可以使用$这个别名,而不会与prototype引起冲突. 本人也是刚刚开始学习JQuery，虽然是在一年之前就已经知道了JQuery，可是之前也就仅仅是知道这个名字而已，今天算是打算开始正式学习JQuery了，先多看看别人的文章先了。 眼馋别人博客上的JS效果而已。 相关文章jQuery代码实现Web页内锚点scoll效果JQuery返回顶部 代码 (wordpress)]]></description>
			<content:encoded><![CDATA[<div id="attachment_35" class="wp-caption aligncenter" style="width: 460px"><a href="http://static.crossyou.cn/wordpress/media/2010/04/jquery_development.jpg"><img class="size-full wp-image-35" title="jquery_development" src="http://static.crossyou.cn/wordpress/media/2010/04/jquery_development.jpg" alt="" width="450" height="80" /></a><p class="wp-caption-text">jquery plugin development</p></div>
<p style="text-align: center;">本文并非原创，主要内容来自以下链接：</p>
<p style="text-align: center;"><a href="http://www.javaeye.com/topic/545971">http://www.javaeye.com/topic/545971</a></p>
<p style="text-align: center;"><a href="http://www.learningjquery.com/2007/10/a-plugin-development-pattern">http://www.learningjquery.com/2007/10/a-plugin-development-pattern</a></p>
<p>今天中午在网上看到一个不错的AD轮播的Demo，因为有提供下载于是下载下来，然后仔细看了下源代码，看到它扩展插件的方法很不错，他的格式是这样的：</p>
<pre class="javascript" name="code">
(function($) {
	$.fn.pluginName = function() {
	// Our plugin implementation code goes here.
};
})(jQuery);
</pre>
<p>在参阅以上文章后才差不多了解了这种扩展方式，正如文中所说，这种方法对象级别的插件扩展，<span style="color: #008000;">而上面定义了一个jQuery函数,形参是$，函数定义完成之后,把jQuery这个实参传递进去.立即调用执行。这样的好处是,我们在写jQuery插件时,也可以使用$这个别名,而不会与prototype引起冲突.</span></p>
<p>本人也是刚刚开始学习JQuery，虽然是在一年之前就已经知道了JQuery，可是之前也就仅仅是知道这个名字而已，今天算是打算开始正式学习JQuery了，先多看看别人的文章先了。</p>
<p>眼馋别人博客上的JS效果而已。</p>
<h4  class="related_post_title">相关文章</h4><ul class="related_post"><li><a href="http://www.crossyou.cn/jquery-web-page-anchor-scoll-show.htm" title="jQuery代码实现Web页内锚点scoll效果">jQuery代码实现Web页内锚点scoll效果</a></li><li><a href="http://www.crossyou.cn/jquery-return-top-code.htm" title="JQuery返回顶部 代码 (wordpress)">JQuery返回顶部 代码 (wordpress)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.crossyou.cn/jquery-plugin-development.htm/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

