<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	>
<channel>
	<title>Comments on: &#8216;Back to top&#8217; link using jQuery</title>
	<atom:link href="http://agyuku.net/2009/05/back-to-top-link-using-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/</link>
	<description>ZOMG! So Simple!</description>
	<pubDate>Thu, 29 Jul 2010 13:30:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Lloyd</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-115</link>
		<dc:creator>Lloyd</dc:creator>
		<pubDate>Sat, 24 Jul 2010 05:15:16 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-115</guid>
		<description>Lili, if it's &lt;a href="http://james.padolsey.com/javascript/simple-pulse-plugin-for-jquery/" target="_blank" rel="nofollow"&gt;this plugin&lt;/a&gt; probably the code above that uses fadeIn():
&lt;code&gt;
 $('#toTop').fadeIn();
&lt;/code&gt;

will include a pulse effect. Not sure if that's what you need.</description>
		<content:encoded><![CDATA[<p>Lili, if it&#8217;s <a href="http://james.padolsey.com/javascript/simple-pulse-plugin-for-jquery/" target="_blank" rel="nofollow">this plugin</a> probably the code above that uses fadeIn():<br />
<code><br />
 $('#toTop').fadeIn();<br />
</code></p>
<p>will include a pulse effect. Not sure if that&#8217;s what you need.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lili</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-114</link>
		<dc:creator>lili</dc:creator>
		<pubDate>Thu, 22 Jul 2010 21:39:04 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-114</guid>
		<description>this is beautiful, thanks for sharing it.  is it possible to include a "pulse" event on load?</description>
		<content:encoded><![CDATA[<p>this is beautiful, thanks for sharing it.  is it possible to include a &#8220;pulse&#8221; event on load?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lloyd</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-109</link>
		<dc:creator>Lloyd</dc:creator>
		<pubDate>Sun, 06 Jun 2010 15:21:17 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-109</guid>
		<description>Ramalho! Thanks for sharing, that would definitely help those who needed it :)
cheers brotha!</description>
		<content:encoded><![CDATA[<p>Ramalho! Thanks for sharing, that would definitely help those who needed it <img src='/simplish/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
cheers brotha!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramalho</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-108</link>
		<dc:creator>Ramalho</dc:creator>
		<pubDate>Sat, 05 Jun 2010 22:26:46 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-108</guid>
		<description>Hi WEB Family,


Good job. For Giovanni follow the instruction below:

The following Javascript will change all &lt;a href="#top" rel="nofollow"&gt; links to scroll to the top instead of the instant jump that normally happens when the link is clicked.
view sourceprint?
1	$(document).ready(function() {
2	    
3	    $('a[href=#top]').click(function(){
4	        $('html, body').animate({scrollTop:0}, 'slow');
5	        return false;
6	    });
7	 
8	});

Note the "return false;" line. This is required otherwise the default action will be done and the instant scroll will happen instead of the nice animated scrolling effect.

The position the document is scrolled to can be different by changing the scrollTop value, the speed by changing the 'slow' value and what appears in the href by chaging the #href value.

Note that an &lt;a&gt;&lt;/a&gt; anchor should still be present in the page for browsers that do not have Javascript on or support jQuery.
The HTML
view sourceprint?
1	&lt;a&gt;&lt;/a&gt;
2	...
3	&lt;a href="#top" rel="nofollow"&gt;Back to top&lt;/a&gt;

Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Hi WEB Family,</p>
<p>Good job. For Giovanni follow the instruction below:</p>
<p>The following Javascript will change all <a href="#top" rel="nofollow"> links to scroll to the top instead of the instant jump that normally happens when the link is clicked.<br />
view sourceprint?<br />
1	$(document).ready(function() {<br />
2<br />
3	    $(&#8217;a[href=#top]&#8216;).click(function(){<br />
4	        $(&#8217;html, body&#8217;).animate({scrollTop:0}, &#8217;slow&#8217;);<br />
5	        return false;<br />
6	    });<br />
7<br />
8	});</p>
<p>Note the &#8220;return false;&#8221; line. This is required otherwise the default action will be done and the instant scroll will happen instead of the nice animated scrolling effect.</p>
<p>The position the document is scrolled to can be different by changing the scrollTop value, the speed by changing the &#8217;slow&#8217; value and what appears in the href by chaging the #href value.</p>
<p>Note that an </a><a></a> anchor should still be present in the page for browsers that do not have Javascript on or support jQuery.<br />
The HTML<br />
view sourceprint?<br />
1	<a></a><br />
2	&#8230;<br />
3	<a href="#top" rel="nofollow">Back to top</a></p>
<p>Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giovanni</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-77</link>
		<dc:creator>Giovanni</dc:creator>
		<pubDate>Mon, 04 Jan 2010 22:29:08 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-77</guid>
		<description>Does anyone know of a similar script that works in IE6?

Thanks.

Giovanni</description>
		<content:encoded><![CDATA[<p>Does anyone know of a similar script that works in IE6?</p>
<p>Thanks.</p>
<p>Giovanni</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lloyd</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-43</link>
		<dc:creator>Lloyd</dc:creator>
		<pubDate>Sat, 21 Nov 2009 06:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-43</guid>
		<description>Hi Julesfrog, first off, thanks for dropping by :)
I apologize that when you visited this post the sample code is busted and you had to look into the source code to get it. 

"I would like it to disappear and stay invisible when the user reaches the 500 mark and anything below." 
- From what I understand you just want the link to appear when it reaches above the 500 mark, unlike my sample which is anything but zero. I changed the code a bit and made it less than or equal to 500 (or any value you wish) to keep the link invisible while the condition is true.

&lt;code&gt;
&lt;script&gt;
	$(window).scroll(function() {
		if($(this).scrollTop() &lt;= 500) {
			$('#toTop').fadeOut();
		} else {			
			$('#toTop').fadeIn();
		}
	});

	$('#toTop').click(function() {
		$('body,html').animate({scrollTop:0},800);
	});
&lt;/script&gt;
&lt;/code&gt;

"Also, at this point, when the page loads, the button doesn’t show unless you start scrolling down. Is there a way to make it appear when the page loads?"

- Why do you want it to appear on page load? When you load the page, the scroll point is at zero (that's less than 500 scroll mark and you want it hidden when it's lower). The code is supposed to show the link &lt;strong&gt;on scroll&lt;/strong&gt;, it will check for the 500 mark as you scroll and showing it when it reaches above it, otherwise, it's hidden 500 to 0 mark (less than or equal). Let me know if I'm not following you :)

Regards,
~Lloyd</description>
		<content:encoded><![CDATA[<p>Hi Julesfrog, first off, thanks for dropping by <img src='/simplish/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I apologize that when you visited this post the sample code is busted and you had to look into the source code to get it. </p>
<p>&#8220;I would like it to disappear and stay invisible when the user reaches the 500 mark and anything below.&#8221;<br />
- From what I understand you just want the link to appear when it reaches above the 500 mark, unlike my sample which is anything but zero. I changed the code a bit and made it less than or equal to 500 (or any value you wish) to keep the link invisible while the condition is true.</p>
<p><code><br />
&lt;script&gt;<br />
	$(window).scroll(function() {<br />
		if($(this).scrollTop() < = 500) {<br />
			$('#toTop').fadeOut();<br />
		} else {<br />
			$('#toTop').fadeIn();<br />
		}<br />
	});</p>
<p>	$('#toTop').click(function() {<br />
		$('body,html').animate({scrollTop:0},800);<br />
	});<br />
&lt;/script&gt;<br />
</code></p>
<p>&#8220;Also, at this point, when the page loads, the button doesn’t show unless you start scrolling down. Is there a way to make it appear when the page loads?&#8221;</p>
<p>- Why do you want it to appear on page load? When you load the page, the scroll point is at zero (that&#8217;s less than 500 scroll mark and you want it hidden when it&#8217;s lower). The code is supposed to show the link <strong>on scroll</strong>, it will check for the 500 mark as you scroll and showing it when it reaches above it, otherwise, it&#8217;s hidden 500 to 0 mark (less than or equal). Let me know if I&#8217;m not following you <img src='/simplish/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regards,<br />
~Lloyd</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julesfrog</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-42</link>
		<dc:creator>Julesfrog</dc:creator>
		<pubDate>Fri, 20 Nov 2009 16:08:29 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-42</guid>
		<description>Hello Lloyd!

First of all, thank you for this great post. It's a great piece of code! Very useful! I'm trying to rewrite it partially so instead of scrolling to the top it scrolls to a another section of the website.

I changed the "0" to "500" 


        jQuery(function() {
                jQuery(this).pngFix();
                jQuery(window).scroll(function() {
                        if(jQuery(this).scrollTop() != 500) {
                                jQuery('#toTop').fadeIn();
                        } else {
                                jQuery('#toTop').fadeOut();
                        }
                });
               
                jQuery('#toTop').click(function() {
                        jQuery('body,html').animate({scrollTop:500},800);
                });
        });


At this point, the button disappears only when the user hit the 500 mark. I would like it to disappear and stay invisible when the user reaches the 500 mark and anything below. I think it's got to do with this line: if(jQuery(this).scrollTop() != 500) but I just don't know the right "wording".

Also, at this point, when the page loads, the button doesn't show unless you start scrolling down. Is there a way to make it appear when the page loads?

I think this is all pretty simple stuff for you and any developers. It's just too much for me at this point. I would appreciate your input and advice.

Thanks!</description>
		<content:encoded><![CDATA[<p>Hello Lloyd!</p>
<p>First of all, thank you for this great post. It&#8217;s a great piece of code! Very useful! I&#8217;m trying to rewrite it partially so instead of scrolling to the top it scrolls to a another section of the website.</p>
<p>I changed the &#8220;0&#8243; to &#8220;500&#8243; </p>
<p>        jQuery(function() {<br />
                jQuery(this).pngFix();<br />
                jQuery(window).scroll(function() {<br />
                        if(jQuery(this).scrollTop() != 500) {<br />
                                jQuery(&#8217;#toTop&#8217;).fadeIn();<br />
                        } else {<br />
                                jQuery(&#8217;#toTop&#8217;).fadeOut();<br />
                        }<br />
                });</p>
<p>                jQuery(&#8217;#toTop&#8217;).click(function() {<br />
                        jQuery(&#8217;body,html&#8217;).animate({scrollTop:500},800);<br />
                });<br />
        });</p>
<p>At this point, the button disappears only when the user hit the 500 mark. I would like it to disappear and stay invisible when the user reaches the 500 mark and anything below. I think it&#8217;s got to do with this line: if(jQuery(this).scrollTop() != 500) but I just don&#8217;t know the right &#8220;wording&#8221;.</p>
<p>Also, at this point, when the page loads, the button doesn&#8217;t show unless you start scrolling down. Is there a way to make it appear when the page loads?</p>
<p>I think this is all pretty simple stuff for you and any developers. It&#8217;s just too much for me at this point. I would appreciate your input and advice.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cath</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-28</link>
		<dc:creator>Cath</dc:creator>
		<pubDate>Mon, 09 Nov 2009 16:32:17 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-28</guid>
		<description>Thanks for the reply, I'm using strict mode already but I managed to get it working by removing 'body' out of...

$('body,html').animate({scrollTop:0},800);

It might be because I'm viewing IE7 through IE8's Developer Tools.

Yeah I've pretty much given up on adding nice effects to IE6 so I excluded it by using the below condition...

$.browser.msie&amp;&amp;($.browser.version == "6.0")&amp;&amp;!window.XMLHttpRequest;

Thanks again, great post</description>
		<content:encoded><![CDATA[<p>Thanks for the reply, I&#8217;m using strict mode already but I managed to get it working by removing &#8216;body&#8217; out of&#8230;</p>
<p>$(&#8217;body,html&#8217;).animate({scrollTop:0},800);</p>
<p>It might be because I&#8217;m viewing IE7 through IE8&#8217;s Developer Tools.</p>
<p>Yeah I&#8217;ve pretty much given up on adding nice effects to IE6 so I excluded it by using the below condition&#8230;</p>
<p>$.browser.msie&amp;&amp;($.browser.version == &#8220;6.0&#8243;)&amp;&amp;!window.XMLHttpRequest;</p>
<p>Thanks again, great post</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lloyd</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-27</link>
		<dc:creator>Lloyd</dc:creator>
		<pubDate>Mon, 09 Nov 2009 15:02:12 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-27</guid>
		<description>hey Cath, your page needs to be at strict mode to make it work in IE7, add this at the top of your page:
&lt;code&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;/code&gt;

oh btw, sorry, it wasn't designed for IE 6 :(</description>
		<content:encoded><![CDATA[<p>hey Cath, your page needs to be at strict mode to make it work in IE7, add this at the top of your page:<br />
<code><br />
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br />
</code></p>
<p>oh btw, sorry, it wasn&#8217;t designed for IE 6 <img src='/simplish/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cath</title>
		<link>http://agyuku.net/2009/05/back-to-top-link-using-jquery/comment-page-1/#comment-26</link>
		<dc:creator>Cath</dc:creator>
		<pubDate>Mon, 09 Nov 2009 14:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://agyuku.net/?p=30#comment-26</guid>
		<description>I love this, couldn't get it working in IE6 or 7 though!</description>
		<content:encoded><![CDATA[<p>I love this, couldn&#8217;t get it working in IE6 or 7 though!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
