Fastest Web Hosting

page scroll to specific id in jquery

0 votes
asked Sep 20, 2016 in Jquery by vinod (2,660 points)

I am trying to get a scroll to div id in jquery code to work correctly.
This my code

$('#myButton').click(function() {
   $.scrollTo($('#thirdDIV'), 2000);

But it is working. Its only snaps to the div.

please help

1 Answer

0 votes
answered Oct 13, 2016 by Hatim Saifuddin (300 points)
$("#myButton").on('click',function() {
    $('html, body').animate({
        'scrollTop' : $("#thirdDIV").position().top

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's