Menu icon Foundation

My Posts

  • 2
    Replies
  • Topbar JS not working

    By Clara

    topbarjavascriptversion

    My topbar is not working properly: it changes when the screen gets small and displays the toggle icon, hiding everything inside 'top-bar-section'. But if I click the toggle nothing happens, neither do my dropdowns work. I've tried to include the files ... (continued)

    Last Reply by Clara almost 6 years ago


My Comments

Clara commented on Clara's post almost 6 years

Ok, I found what's wrong, the

 <script src="<?=base_url()?>bower_components/foundation/js/foundation.js"></script>
<script src="<?=base_url()?>bower_components/foundation/js/foundation/foundation.topbar.js"></script>

must be on the body tag, just before the

 $(document).foundation();

and not on the head, because the head loads later than the body. Now everything works like a charm :)

Clara commented on Clara's post almost 6 years

I've looked into the console and I get the following JS errors:

 TypeError: Layer must be a document node

...ection.rangeCount&&!selection.isCollapsed){return true}if(!this.deviceIsIOS4){if...

foundation.js (línea 34)
 ReferenceError: Foundation is not defined

Foundation.libs.topbar = {

foundation.topbar.js (línea 4)
 TypeError: $(...).foundation is not a function

$(document).foundation();

So I guess it's not only the topbar but all the Foundation JS that is not loading...

Clara commented on Jeremy Englert's post almost 6 years

I agree, I sometimes want to answer or comment on posts that are already closed and the only solution I see is to open a new one about the same topic, which I think will clutter the forum.

Posts Followed

No Content

Following

    No Content

Followers

My Posts


My Comments

You commented on Clara's post almost 6 years

Ok, I found what's wrong, the

 <script src="<?=base_url()?>bower_components/foundation/js/foundation.js"></script>
<script src="<?=base_url()?>bower_components/foundation/js/foundation/foundation.topbar.js"></script>

must be on the body tag, just before the

 $(document).foundation();

and not on the head, because the head loads later than the body. Now everything works like a charm :)

You commented on Clara's post almost 6 years

I've looked into the console and I get the following JS errors:

 TypeError: Layer must be a document node

...ection.rangeCount&&!selection.isCollapsed){return true}if(!this.deviceIsIOS4){if...

foundation.js (línea 34)
 ReferenceError: Foundation is not defined

Foundation.libs.topbar = {

foundation.topbar.js (línea 4)
 TypeError: $(...).foundation is not a function

$(document).foundation();

So I guess it's not only the topbar but all the Foundation JS that is not loading...

You commented on Jeremy Englert's post almost 6 years

I agree, I sometimes want to answer or comment on posts that are already closed and the only solution I see is to open a new one about the same topic, which I think will clutter the forum.

Posts Followed

No Content

Following

  • No Content

Followers

  • No Content