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: enter image description here

i want use scrolltop:

enter image description here

i want scroll down:

enter image description here

and more scroll:

enter image description here

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

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -