Hi, I'm trying to figure out how to get rid of the "scroll to top" link when the displayed icon fades out. I'm using a wordpress plugin called jQuery Smooth Scroll and everything is working well. Well, almost.

When scrolling down, an arrow image appears at the bottom right of the page to allow the user to scroll back up in one click. When clicking on this image/link, the browser takes the user all the way up and even though the arrow image fades out, the link to scroll up remains. You can't see it, but it's there. And you can still click on it to scroll back up even though you haven't scrolled down yet.

Here is the js code the plugin uses

Code:
/* Smooth Back to Top, Get This functionality from: http://wordpress.org/extend/plugins/cudazi-scroll-to-top/ */

jQuery.noConflict();
jQuery(function($) {
	
	// When to show the scroll link
	// higher number = scroll link appears further down the page	
	var upperLimit = 2000; 
		
	// Our scroll link element
	var scrollElem = $('a#scroll-to-top');
	
	// Scroll to top speed
	var scrollSpeed = 500;
	
	// Show and hide the scroll to top link based on scroll position	
	scrollElem.hide();
	$(window).scroll(function () { 			
		var scrollTop = $(document).scrollTop();		
		if ( scrollTop > upperLimit ) {
			$(scrollElem).stop().fadeTo(300, 1); // fade back in			
		}else{		
			$(scrollElem).stop().fadeTo(300, 0); // fade out
		}
	});

	// Scroll to top animation on click
	$(scrollElem).click(function(){ 
		$('html, body').animate({scrollTop:0}, scrollSpeed); return false; 
	});

});
What to change to make the link appear when the arrow icon fades in, and make it disappear when the arrow icon fades out?

Thanks in advance,
Kimberley