Reputation: 93
The code has to be in my ajax call back i have tried the below and it didn't work has anyone got a solution to this for me please because my client once the transitions to be smooth but at the minute they are all choppy except in mozilla.
success: function(data)
{
if(jQuery( ".frequency" ).html(data)){
//jQuery('html, body').animate({ scrollTop: jQuery('#2010').offset().top }, 'slow');
document.getElementById('dynamictabstrp').scrollIntoView({behavior: "smooth"});
}
}
The alternative code i tried was the .animate but did nothing.
Upvotes: 3
Views: 18911
Reputation: 137
I'm from Argentina and I normally speak in Spanish, so, sorry for my English.
Here's the solution i've found in this website: https://blog.hospodarets.com/native_smooth_scrolling
For CSS things are even more better. Just add one line of the code:
That code work with my site perfectly. To make this work you have to assign an element with the value of the href attribute to an anchor point, for example: , in the other hand, you have to precise some point in your document that is the place you want to go after click on the link, for example: , make sure you write the appropiate attribute, that is name; in the value of this attribute you have to put the keywords you use in the link without the hashtag.
Besides, I'm looking information in the web that tell me how to change the time of the effect. I've tried by adding some values to the scroll-behavior property as 5s ease-out like a example in the web, but it didn't work for me.
Hope I contribute with your work, have a nice day.
Lucas J. Guerra P.
Upvotes: 12