2014-10-09 52 views
0

我一直在嘗試在WordPress中使用http://tympanus.net/codrops/2013/08/13/multi-level-push-menu設置移動菜單。我已經建立了一個自定義的步行者爲WP所輸出正確類和結構,但是在頁面加載我繼續得到mlPushMenu無法讀取屬性'addEventListener'

Uncaught TypeError: Cannot read property 'addEventListener' of null line 114 

在頁面的頁腳我打電話

new mlPushMenu(document.getElementById('mp-menu'), document.getElementById('trigger'), { 
      type : 'cover' 
     }); 

文件mlpushmenu.js線114是

// open (or close) the menu 
     this.trigger.addEventListener(this.eventtype, function(ev) { 

的文件位於 - http://dev.qdconstruction.com/wp-content/themes/q-and-d/js/mlpushmenu.js?ver=20140206

我覺得好像我有一切需要菜單正常工作,但JS錯誤似乎是我的菜單與封面效果不能正常工作的原因。

回答

0

我看到我的方式

<a data-rel="mobile-menu" href="#" id="trigger" class="menu-trigger">menu</a> 

我需要ID =觸發設置錯誤。