Post

jQueryjQuery

S
Swetha Shetty

Posted on 19th April 2024|39 views

0
votes

Jquery Scroll To Element

How to smoothly scroll to an element using JQuery?

Answers
P
sri kanth

Posted on 19th April 2024

If you want to smoothly scroll to an element in jQuery then you can do something like this

$(document).ready(function() {

 $("#btn").click(function()

 { 

$("body,html").animate( 

{ scrollTop: $("#menudiv").offset().top },

 500 //speed ); 

});

 });

If you are looking for the Jquery certification course, you can check out this Jquery course by Mindmajix.

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos