Shape 5

Joomla Free Templates => Design Control - Free => : masoonic September 11, 2014, 05:57:40 AM



: add fadeIn to scroll top
: masoonic 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));
jQuery(document).ready(function(){
      jQuery('html').smoothScroll(700);
   });
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";
      window.setTimeout(s5_hide_scroll_to_top_fadein_class,300);}
   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();});
jQuery(window).resize(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);
}
</script>
<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>
</div>


: Re: add fadeIn to scroll top
: mikek September 11, 2014, 06:12:14 AM
Hello,

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.