css - How to use jQuery scrollTop and scroll down -
how use scrolltop
, scroll down in jquery?
<div class="wrapper"> <div class="content"> <div class="items"> texttext </div> <div class="prev button">prev</div> <div class="next button">next</div> </div> </div>
i've created:
i want use scrolltop
:
i want scroll down:
and more scroll:
see jsfiddle: http://jsfiddle.net/kisspa/xembz/
<script> $(document).ready(function() { $(window).scroll(function() { if ($(this).scrolltop() > 200) { $('#scrolltotop').fadein(200); } else { $('#scrolltotop').fadeout(200); } }); // animate scroll top $('#scrolltotop').click(function(event) { event.preventdefault(); $('html, body').animate({scrolltop: 0}, 600); }) }); </script> <a href="javascript:void(0)" id="scrolltotop">scroll top</a>
Comments
Post a Comment