Skip to content

KocetoIvanov/JavaScript-Snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

JavaScript-Snippets

Most examples come from the Sitefinity project and some of the classes, ids and html structure of them, can be strange, but it can easily be transformed and used everywhere and as needed for everyone.


Sticky navigation on scroll with Pure Javascript

Link to a script file


JavaScript Sitefinity Accordion with Pure Javascript

function stickyNavigation() {
  window.onscroll = function (e) {
    var y = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop,
        navId = document.getElementById("navigation"),
        navOffsetTop = navId.offsetTop;
    if (y >= navOffsetTop) {
      navId.className = 'stick';
    } else {
      navId.className = '';
    }
  }
}

Link to a script file


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published