jQuery scroll back to top simple

0

Radio Dalam – jQuery sederhana membuat event klik dengan jQuery skroll kembali ke halaman paling atas.

$(function(){
  $('elemen').on('click', function (e) {
    e.preventDefault();
    $('html, body').animate({scrollTop:0},700);
  });
});

Contoh: jsfiddle

LEAVE A REPLY

Please enter your comment!
Please enter your name here