Download pool/shard004/JavaScript/0025248_Section.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 980 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard004/JavaScript/0025248_Section.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard004/JavaScript/0025248_Section.js
-
curl -L -o 0025248_Section.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard004/JavaScript/0025248_Section.js
980 Bytes
| /** | |
| * Simple module for navigating between section of the site. | |
| */ | |
| var Section = (function($) { | |
| /** | |
| * Toggle a section. | |
| * | |
| * @param {object} section The jQuery object <section> element | |
| */ | |
| var goTo = function(section) { | |
| // Get the current section | |
| currentSection = $('.site-section--active'); | |
| // Navigate to the new section | |
| _goAway(currentSection); | |
| _comeHere(section); | |
| }; | |
| /** | |
| * Hide a section. | |
| * | |
| * @param {object} section The jQuery object <section> element | |
| */ | |
| var _goAway = function(section) { | |
| section.removeClass('site-section--active'); | |
| }; | |
| /** | |
| * Bring a section into view. | |
| * | |
| * @param {object} section The jQuery object <section> element | |
| */ | |
| var _comeHere = function(section) { | |
| section.addClass('site-section--active'); | |
| }; | |
| /** | |
| * Return public methods. | |
| */ | |
| return { | |
| goTo: goTo | |
| }; | |
| })(jQuery); | |