Hi, Guest
0 Members and 1 Guest are viewing this topic.
<a href="#" class="scrolltotop">Deruleaza pagina sus</a>
.scrolltotop { width:40px; height:40px; opacity:0.3; position:fixed; bottom:50px; right:100px; display:none; text-indent:-9999px; background: url('imagine.png') no-repeat;}
$(window).scroll(function(){ if ($(this).scrollTop() > 100) { $('.scrolltotop').fadeIn(); } else { $('.scrolltotop').fadeOut(); }});
$('.scrolltotop').click(function(){ $("html, body").animate({ scrollTop: 0 }, 600); return false;});
<script type="text/javascript"> $(document).ready(function(){ $(window).scroll(function(){ if ($(this).scrollTop() > 100) { $('.scrolltotop').fadeIn(); } else { $('.scrolltotop').fadeOut(); } }); $('.scrolltotop').click(function(){ $("html, body").animate({ scrollTop: 0 }, 600); return false; }); });</script>