编辑:我刚刚意识到,如果我在画廊页面上等待大约10秒钟然后尝试调出流行音乐库,那么它会起作用但是如果我很快就会尝试进入弹出式画廊到达页面。可能导致这种情况的原因是什么?
我使用的是Fancybox2 gem,它可以在开发中使用,但在使用heroku时它会在生产中产生效果。
当我点击图像对象以显示弹出式图库时,由于某种原因,我的滚动条和页脚从页面中消失。这感觉就像一个浏览问题,但我是javascript / jquery的新手,所以不完全确定这里发生了什么。
我通过亚马逊s3连接画廊的图像,所以他们不应该让应用程序响应缓慢或任何东西。这是我的代码:
<div class="gallery-container">
<div class="gallery-coming-soon">
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="picbox">
<a class="fancybox" rel="group" href="https://s3-us-west-1.amazonaws.com/sfpourhouse1/sfpourhousepicture5.jpg"><img src="https://s3-us-west-1.amazonaws.com/sfpourhouse1/pic10thumb.jpg" alt="" /></a>
</div>
<div class="picbox">
<a class="fancybox" rel="group" href="https://s3-us-west-1.amazonaws.com/sfpourhouse1/sfpourhousepicture7.jpg"><img src="https://s3-us-west-1.amazonaws.com/sfpourhouse1/pic2thumb.jpg" alt="" /></a>
</div>
<div class="picbox">
<a class="fancybox" rel="group" href="https://s3-us-west-1.amazonaws.com/sfpourhouse1/sfpourhousepicture8.jpg"><img src="https://s3-us-west-1.amazonaws.com/sfpourhouse1/pic3thumb.jpg" alt="" /></a>
</div>
</div>
<div class="col-sm-4">
<div class="picbox">
<a class="fancybox" rel="group" href="https://s3-us-west-1.amazonaws.com/sfpourhouse1/sfpourhousepicture4.jpg"><img src="https://s3-us-west-1.amazonaws.com/sfpourhouse1/pic4thumb.jpg" alt="" /></a>
</div>
<div class="picbox">
<a class="fancybox" rel="group" href="https://s3-us-west-1.amazonaws.com/sfpourhouse1/sfpourhousepicture1.jpg"><img src="https://s3-us-west-1.amazonaws.com/sfpourhouse1/pic5thumb.jpg" alt="" /></a>
</div>
<div class="picbox">
<a class="fancybox" rel="group" href="https://s3-us-west-1.amazonaws.com/sfpourhouse1/sfpourhousepicture3.jpg"><img src="https://s3-us-west-1.amazonaws.com/sfpourhouse1/pic6thumb.jpg" alt="" /></a>
</div>
</div>
<div class="col-sm-4">
<div class="picbox">
<a class="fancybox" rel="group" href="https://s3-us-west-1.amazonaws.com/sfpourhouse1/sfpourhousepicture2.jpg"><img src="https://s3-us-west-1.amazonaws.com/sfpourhouse1/pic7thumb.jpg" alt="" /></a>
</div>
<div class="picbox">
<a class="fancybox" rel="group" href="https://s3-us-west-1.amazonaws.com/sfpourhouse1/sfpourhousepicture9.jpg"><img src="https://s3-us-west-1.amazonaws.com/sfpourhouse1/pic8thumb.jpg" alt="" /></a>
</div>
<div class="picbox">
<a class="fancybox" rel="group" href="https://s3-us-west-1.amazonaws.com/sfpourhouse1/sfpourhousepicture6.jpg"><img src="https://s3-us-west-1.amazonaws.com/sfpourhouse1/pic9thumb.jpg" alt="" /></a>
</div>
</div>
</div>
</div>
</div>
</div>
还有:
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag "application", media: "all",
"data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
<script type="text/javascript">
$(document).ready(function() {
$("a.fancybox").fancybox();
});
</script>
</head>
<body>
有谁知道出了什么问题?弹出功能似乎可能破了,或者发生了什么?也许这是在生产级别安装宝石的东西?