我正在使用Vocino的基础设施和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()
........
从视觉角度看,一切都很美好。但悬停时,下拉列表不起作用。在构建之后,自从我取消注释行=require foundation/foundation
后,我也收到app.js.coffee的错误。我现在已经摆弄了半天,阅读其他帖子并没有找到解决办法。这可能是一件非常简单的事情,我只是在这个新环境中失踪了。
答案 0 :(得分:1)
我是中间人 - 基础模板的创建者。最近我改变了它的工作方式并更新了回购。基本上,如果您正在使用粉底宝石,那么您不需要使用模板,因为您应该直接从宝石中提取适当的混合物,而不是在那里使用所有Sass。
如果您想使用模板方法(并且可以编辑所有Sass文件),您可能需要提取新版本。
如果您需要直接帮助您的项目,请随时通过Twitter与我联系。
最佳,
特拉维斯