我的fancybox完美地在我的开发环境中工作,但是当我推向Heroku制作时,它并不起作用。我已经尝试在这里查看所有帮助(预编译资产等),尝试了所有内容,但似乎无法让它发挥作用!希望有人可以帮助我......
这是我的application.html.erb:
<html>
<head>
<%= analytics_init if Rails.env.production? %>
<%= favicon_link_tag "/favicon.ico" %>
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:200,300,400,500,600,700,900' rel='stylesheet' type='text/css'>
<!-- Add jQuery library -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<!-- WORLD MAP -->
<link href="/assets/jqvmap.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/jquery.vmap.js" type="text/javascript"></script>
<script src="/assets/jquery.vmap.world.js" type="text/javascript"></script>
<!-- Add fancyBox -->
<link rel="stylesheet" href="/fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
</head>
<body>
<%= render "layouts/header" unless @disable_header %>
<%=yield %>
</body>
</html>
我的application.js:
//= require rails_autocomplete
//= require jquery
//= require jquery_ujs
//= require jquery.fancybox
//= require jquery.turbolinks
//= require turbolinks
//= require bxslider
//= require fancybox
//= require_tree .
var fancybox = function(){
$('.fancybox').fancybox({
parent: "body",
helpers: {
overlay: {
locked: false
}
}
});
};
$(document).on("page:load ready", fancybox);
如果有人看到我不喜欢的东西,那就太好了 - 或者至少指出我如何在Heroku Production中调试这个。提前谢谢!
答案 0 :(得分:0)