Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery .animate() method

0 votes
19 views
added Jun 29, 2018 in jQuery by LC Marshal Lieutenant (15,850 points)
edited Dec 5, 2018 by LC Marshal
//scrollTop for scroll to the top animation
$('#button').click(function(){
  $('html, body').animate({scrollTop:0}, 'slow');
});

//example 2
$('.scroll-top--button').click(function(){
  $('html, body').animate({ scrollTop: 0 }, 600);
  return false;
});

1 Response

0 votes
responded Jan 24 by LC Marshal Lieutenant (15,850 points)
$('.className').animate({right: "-700px"}, 2000);

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...