Sha256: 33aed85e1f7e8630f6e5bb59e22065a20d872c94f71fff9fe474a13b4cdf9579

Contents?: true

Size: 661 Bytes

Versions: 1

Compression:

Stored size: 661 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');

    pull.addEventListener('click', function(e) {
        menu.classList.toggle('hide');
    });

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

Version data entries

1 entries across 1 versions & 1 rubygems

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