Sha256: 971e202bfddf6e700fe37234926385d10a07912a326f37835f70367bd73018b6

Contents?: true

Size: 710 Bytes

Versions: 1

Compression:

Stored size: 710 Bytes

Contents

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 (e) {
      menu.classList.toggle('hide')
    }, false);
  });

  /*
   * Make the header images move on scroll
   */
  window.addEventListener('scroll', function () {
    var x = window.pageYOffset || document.body.scrollTop;
    var main = document.getElementById("main");
    var mainStyle = main.style;

    mainStyle.backgroundPosition = '100% ' + parseInt(-x / 3) + 'px' + ', 0%, center top';
  });
});

Version data entries

1 entries across 1 versions & 1 rubygems

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