Forum Support

Shape 5
September 16, 2021, 07:37:20 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Shape 5 Forum
   Home   Help Search Login Register  
Pages: [1]
Author Topic: add fadeIn to scroll top  (Read 267 times)
Jr. Member
Offline Offline

Posts: 5

« on: September 11, 2014, 05:57:40 AM »

How can i add fadeIn to this scroll top function???
mean when I scroll down the  scroll to top showed and when I scroll up not showed....Or when scroll 100 it's showed and when less than not showed....
thanks to help me,,

it's the default design_control template codes for this function

<script type="text/javascript">
/*! Jquery scrollto function */
(function(a,c){var b=(function(){var d=c(a.documentElement),f=c(a.body),e;if(d.scrollTop()){return d}else{e=f.scrollTop();if(f.scrollTop(e+1).scrollTop()==e){return d}else{return f.scrollTop(e)}}}());c.fn.smoothScroll=function(d){d=~~d||400;return this.find('a[href*="#s5"]').click(function(f){var g=this.hash,e=c(g);if(location.pathname.replace(/^\//,'')===this.pathname.replace(/^\//,'')&&location.hostname===this.hostname){if(e.length){f.preventDefault();b.stop().animate({scrollTop:e.offset().top},d,function(){location.hash=g})}}}).end()}}(document,jQuery));
function s5_page_scroll(obj){ if(jQuery.browser.mozilla) var target = 'html'; else var target='html body'; jQuery(target).stop().animate({scrollTop:jQuery(obj).offset().top},700,function(){location.hash=obj}); }
function s5_hide_scroll_to_top_display_none() { if (window.pageYOffset < 300) { document.getElementById("s5_scrolltopvar").style.display = "none"; } }
function s5_hide_scroll_to_top_fadein_class() { document.getElementById("s5_scrolltopvar").className = "s5_scrolltop_fadein"; }
function s5_hide_scroll_to_top() {
   if (window.pageYOffset >= 300) {document.getElementById("s5_scrolltopvar").style.display = "block";
      document.getElementById("s5_scrolltopvar").style.visibility = "visible";
   else {document.getElementById("s5_scrolltopvar").className = "s5_scrolltop_fadeout";window.setTimeout(s5_hide_scroll_to_top_display_none,300);}}
jQuery(document).ready( function() {s5_hide_scroll_to_top();});
if(window.addEventListener) {
   window.addEventListener('scroll', s5_hide_scroll_to_top, false);   
else if (window.attachEvent) {
   window.attachEvent('onscroll', s5_hide_scroll_to_top);
<div id="s5_scrolltopvar" class="s5_scrolltop_fadeout" style="visibility:hidden">
<a href="#s5_scrolltotop" id="s5_scrolltop_a" class="s5_scrolltotop"><?php if ($template_date == "June 2011") {?>Scroll Up<?php ?></a>
Offline Offline

Posts: 28743

« Reply #1 on: September 11, 2014, 06:12:14 AM »


The scroll functionality only scrolls the page, adding in an automatic fade in option for elements on the page would require custom programming. We don't provide those services.

Mike Knott
Shape 5 Team

- Need a great host for your website? We highly recommend!

- Put your trust in the hands of our extremely qualified staff to get your job done right!

- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
Pages: [1]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by
Valid XHTML 1.0! Valid CSS!
Looking for the largest variety in template designs? Look no more. Never buy 1 theme again. Signups start at just $89 for access to all of our themes.
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.