Pendigard's picture
Upload folder using huggingface_hub (part 33)
e1d589b verified
Raw History Blame Contribute Delete
660 Bytes
define(['domReady','jquery','jqueryEasing'], function(domReady) {
var smoothScroll = function(evt){
evt.preventDefault();
var anchor = $(evt.target).attr('href');
if (typeof anchor === 'undefined' || anchor === '') {
return;
}
try {
$('html,body').stop().animate({
scrollTop: (anchor === '#top' ? 0 : $(anchor).offset().top)
},750, 'easeInOutExpo');
setTimeout(function(){
window.location.hash = anchor;
}, 850);
} catch (exception) {
window.location.hash = anchor;
}
return false;
};
domReady(function(){
$('a[href^="#"]').on('click', smoothScroll);
});
});