Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Gábor Papp
Added: Feb 28, 2018 5:06 AM
Views: 8
Tags: no tags
  1. function smooth_scroll(hova) {
  2.     // var contentPosTop = $(hova).position().top;
  3.     var contentPosTop = $(hova).offset().top-200;
  4.     console.log('TOP: ' + contentPosTop + ' - ' + contentPosTop);
  5.     $('html, body').stop().animate({
  6.         scrollTop: contentPosTop
  7.     }, 1500);
  8. }