Download pool/shard002/JavaScript/0012736_smooth-scroll.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 660 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard002/JavaScript/0012736_smooth-scroll.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard002/JavaScript/0012736_smooth-scroll.js
-
curl -L -o 0012736_smooth-scroll.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard002/JavaScript/0012736_smooth-scroll.js
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); | |
| }); | |
| }); | |