$(document).ready(function() {$("a[href='#top']").click(function() {$("html, body").animate({ scrollTop: 0 }, "1");$('html, body').stop(true, true);
//Anything else you want to do in the same action goes here
return false;});});
var scrollToTop = window.setInterval(function() {var pos = window.pageYOffset;if ( pos > 0 ) {window.scrollTo( 0, pos - 20 ); // how far to scroll on each step} else {window.clearInterval( scrollToTop );}}, 16); // how fast to scroll (this equals roughly 60 fps)
document.getElementById("jarscroolbtn").addEventListener("click", jarscrollfunction);
function jarscrollfunction() {var body = document.body; // For Safarivar html = document.documentElement; // Chrome, Firefox, IE and Operabody.scrollTop = 0;html.scrollTop = 0;}
document.querySelector('.sample-modal .popup-cta').scrollIntoView(true);document.querySelector('.sample-modal').style.scrollPadding = '50px'; //to move to the top when scrolled up.