Why use all this code (i've see in archive plugin) when u can simply use…
-
This little bit code? ??
<a href="#" class="scrollup">Scroll</a>
.scrollup{ width:40px; height:40px; opacity:0.3; position:fixed; bottom:50px; right:100px; display:none; text-indent:-9999px; background: url('icon_top.png') no-repeat; }
—
<script type="text/javascript"> $(document).ready(function(){ $(window).scroll(function(){ if ($(this).scrollTop() > 100) { $('.scrollup').fadeIn(); } else { $('.scrollup').fadeOut(); } }); $('.scrollup').click(function(){ $("html, body").animate({ scrollTop: 0 }, 600); return false; }); }); </script>
Source + demo: https://gazpo.com/2012/02/scrolltop/
https://www.ads-software.com/extend/plugins/jquery-smooth-scroll/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Why use all this code (i've see in archive plugin) when u can simply use…’ is closed to new replies.