jQuery .animate() method

0 votes
528 views
added Jun 29, 2018 in jQuery by LC Marshal Captain (25,790 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,790 points)
$('.className').animate({right: "-700px"}, 2000);

 

0 votes
responded Feb 18, 2020 by lcjr First Warrant Officer (11,830 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.
...