ComputerWolf / SlickNav

Responsive Mobile Menu Plugin for jQuery
MIT License
939 stars 314 forks source link

Slicknav is not Running #111

Closed talkinggoat closed 9 years ago

talkinggoat commented 9 years ago

For some reason, slicknav is not running on my site. All of the scripts seem to be loading correctly and the console doesn't show any errors that have anything to do with SlickNav. I don't see any duplicate jquery loads.

The scripts in the head:

  <script src="/media/system/js/mootools-core.js" type="text/javascript"></script>
  <script src="/media/system/js/core.js" type="text/javascript"></script>
  <script src="/media/system/js/mootools-more.js" type="text/javascript"></script>
  <script src="/media/system/js/modal.js" type="text/javascript"></script>
  <script src="/media/jui/js/jquery.min.js" type="text/javascript"></script>
  <script src="/media/jui/js/jquery-noconflict.js" type="text/javascript"></script>
  <script src="/media/jui/js/jquery-migrate.min.js" type="text/javascript"></script>
  <script src="/components/com_k2/js/k2.js?v2.6.9&amp;sitepath=/" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets/js/vmsite.js?vmver=8847" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js?vmver=8847" type="text/javascript" defer="defer"></script>
  <script src="/components/com_virtuemart/assets/js/vmprices.js?vmver=8847" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets/js/vmkeepalive.js?vmver=8847" type="text/javascript" defer="defer" async="async"></script>
  <script src="/plugins/system/slprettyphoto/slprettyphoto/js/jquery.prettyPhoto.js" type="text/javascript"></script>
  <script src="/media/jui/js/bootstrap.min.js" type="text/javascript"></script>
  <script src="/media/sourcecoast/js/jq-bootstrap-1.8.3.js" type="text/javascript"></script>

Even if I completely remove the scripts, above, and mirror the SlickNav site, it still won't populate the mobile menu.

The call at the bottom of the page is,

    $(function(){
              $('#menu').slicknav({
                prependTo:'#mobileMenu',
                label:''
              });

          });

The menu is a ul-li-a list:

<ul class="nav menu" id="menu">
<li class="item-124">
<a href="/index.php" >Home</a>
</li>
...
</ul>

This is where it is supposed to plug in:

<div id="mobileMenu"></div>

It is not populating the #mobileMenu div, at all. Nothing shows up. Any ideas?

cawdev commented 9 years ago

From your head snippet, it doesn't look like the minified slicknav script is there. Also, did you remember to include the CSS?

.slicknav_menu {
    display:none;
}

@media screen and (max-width: 40em) {
    /* #menu is the original menu */
    .js #menu {
        display:none;
    }

   .js .slicknav_menu {
        display:block;
    }
}