foundation-rails 6.3.10 and rails 5.1.3 javascript is not working tap-bar is only displaying elements dropdown is not working -
dropdown not working. seams java script not working
i using foundation-rails 6.3.10 , rails 5.1.3 javascript not working. tap-bar
displaying elements, dropdown not working. looks javascript not working @ all!
do have include:
<%= javascript_include_tag "vendor/modernizr" %>
i managed make work.
first have add jquery, here question explaining how
foundation needs jquery work properly. so, in short, have install yarn if don't have , execute within project:
yarn add jquery
after add jquery application.js. application.js file looks this:
//= require rails-ujs //= require turbolinks //= require jquery //= require foundation //= require_tree .
be careful require jquery , foundation after turbolinks.
next step create foundation_load.coffee file. can put code in load foundation turbolinks around:
$(document).on('turbolinks:load', () -> $(document).foundation() )
that being done, have 1 last thing do. seems file "foundation_and_overrides.scss" not generated. if @ it, you'll see
@include foundation-drilldown-menu; @include foundation-dropdown; @include foundation-dropdown-menu;
are imported before:
@include foundation-menu;
thus, foundation-menu css rules override foundation-dropdown css rules. crazy should complete opposite. put these imports after foundation-menu , should go. :)
Comments
Post a Comment