(function($) { var isTransitioned = true, transparent = 0, translucent = 0.3, opaque = 1; $(function() { $("body").each(function(i) { $(this).prepend('Top\nTop of page'); }); $(".stt-gototop").click(function() { $.scrollTo($($(this).attr('href')), 750); return false; }); $(".stt-gototop").fadeTo(0, translucent); $(".stt-gototop").mouseover(function() { if(isTransitioned) { $(this).fadeTo("slow", opaque); } }).mouseout(function() { if(isTransitioned) { $(this).fadeTo("slow", translucent); } }); }); })(jQuery);