trulia / hologram

A markdown based documentation system for style guides.
http://trulia.github.io/hologram
Other
2.16k stars 199 forks source link

jQuery Code is not working in hologram example #227

Open philipisik opened 9 years ago

philipisik commented 9 years ago

Hi guys,

I had written the following jQuery code. It's working fine on my website, but fails in the generated style guide. The init function is called successfully, but if I'm clicking on the .menu__btn, the script doesn't call the toggle function. Is there anything wrong with my script for hologram?

var Menu = (function() {

    var $menuBtn = $('.menu__btn'),
        $menuPopupGlobal = $('.menu__popup');

    var init = function() {
        // Toggle Menu Popup
        $menuBtn.on('click', toggle);
        console.log('Menu init');
    };

    var toggle = function(e) {
        console.log('Menu Toggle');

        // ...
    };

    return {
        init: init
    };

})();

$(document).ready( Menu.init );