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
64 views
added Jun 29, 2018 in jQuery by LC Marshal Captain (25,680 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;
});

2 Responses

0 votes
responded Jan 24, 2019 by LC Marshal Captain (25,680 points)
$('.className').animate({right: "-700px"}, 2000);

 

0 votes
responded Feb 18 by lcjr Sergeant (2,320 points)
 $(close).click(function() {  
    expand.animate({height: '200px', width: '300px'});
});

 

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