Sha256: 82e3a1117ec9d87158415fbfea5999b9b961e946bea539e8c3dc430533d01bd6

Contents?: true

Size: 705 Bytes

Versions: 2

Compression:

Stored size: 705 Bytes

Contents

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

  /*
   * Display the menu items on smaller screens
   */
  var pull = document.getElementById('pull');
  var 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 () {
    var offset = -(window.scrollY || window.pageYOffset || document.body.scrollTop) / 3;
    document.getElementById("main").style.backgroundPosition = '100% ' + (offset - 50) + 'px' + ', 0%, center top';
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
type-on-strap-2.3.11 assets/js/partials/navbar.js
type-on-strap-2.3.10 assets/js/partials/navbar.js