0

我正在使用 Vocino 的 Foundation w/Middleman 设置构建一个站点,但在使下拉链接正常工作时遇到了问题。

这是我的 layout.haml:

html.no-js
 %head
   %meta{:charset => "utf-8"}
   %meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}
   %meta{:content => "width=device-width", :name => "viewport"}

   %title= data.page.title || "ZURB Foundation"
   / Included CSS Files
   = stylesheet_link_tag "app"
   = javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'
   = javascript_include_tag "vendor/custom.modernizr.js"  

 %body{:class => page_classes}
  %header
   = partial 'nav_bar'
   %section{:role => "main", :class => "main"}= yield
   %footer
   -# Application Javascript, safe to override
   = javascript_include_tag "app"

   -# Google Analytics
   = javascript_include_tag "google_analytics"

我的 _nav_bar.html.haml 简而言之:

%nav.top-bar
 %ul.title-area
  / Title Area
   %li.name
    %h1
     %a{href: "#"}
      Top Bar Title
   %li.toggle-topbar.menu-icon
     %a{href: "#"}
      span menu
 %section.top-bar-section
  / Right Nav Section
  %ul.right
   %li.divider
    %li.has-dropdown
     %a{href: "#"} Main Item 1
     .......

我的 app.js.coffee 的开始:

#= require "vendor/jquery"

# Foundation Javascript
= require "foundation/foundation"

(($, window, undefined_) ->
  "use strict"
  $doc = $(document)
  Modernizr = window.Modernizr
  $(document).ready ->
    $(document).foundation()
  ........

从视觉角度来看,一切看起来都很好。但是悬停时下拉菜单不起作用。在构建时,自从我取消注释该行以来,我也收到了 app.js.coffee 的错误=require foundation/foundation。我一直在摆弄半天,并阅读其他帖子并没有找到解决方法。在这个新环境中我只是缺少一些非常简单的东西。

4

1 回答 1

1

我是中间人基础模板的创建者。最近我改变了它的工作方式并更新了 repo。基本上,如果您使用的是基础 gem,那么您实际上不需要使用模板,因为您应该直接从 gem 中提取适当的 mixin,而不是让所有的 Sass 都在那里。

如果您想使用模板方法(并拥有所有可编辑的 Sass 文件),您可能需要拉取新版本。

如果您的项目需要直接帮助,请随时通过 Twitter 与我联系。

最好的,

特拉维斯

于 2013-11-04T18:11:34.340 回答