Sha256: 0b93193672b5e86048992937476b53b9e7cf0f230c066bdcc05ee2722898d211

Contents?: true

Size: 711 Bytes

Versions: 4

Compression:

Stored size: 711 Bytes

Contents

/* @preserve Navbar */
document.addEventListener("DOMContentLoaded", function (event) {

  /*
   * Display the menu items on smaller screens
   */
  const pull = document.getElementById('pull');
  const menu = document.querySelector('nav ul');

  ['click', 'touch'].forEach(function (e) {
    pull.addEventListener(e, function () {
      menu.classList.toggle('hide')
    }, false);
  });

  /*
   * Make the header images move on scroll
   */
  window.addEventListener('scroll', function () {
    const offset = -(window.scrollY || window.pageYOffset || document.body.scrollTop) / 3;
    document.getElementById("main").style.backgroundPosition = '100% ' + (offset - 50) + 'px' + ', 0%, center top';
  });
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
type-on-strap-2.4.3 assets/js/partials/navbar.js
type-on-strap-2.4.2 assets/js/partials/navbar.js
type-on-strap-2.4.1 assets/js/partials/navbar.js
type-on-strap-2.4.0 assets/js/partials/navbar.js