1

就从图片移动到图片而言,我似乎让 Twitter Bootstrap 轮播正常工作,但是,图片没有显示。我得到下面的小图像图标,我看到它们以适当的间隔在页面上滑动。我正在尝试在我的本地主机上的 rails 项目中使用它。我是编程新手,我为尝试找到答案而进行的所有搜索都没有成功。下面我包含了 HTML。此外,图像位于 HTML 中下面列出的源位置,它们是 jpeg。

如果这有什么不同,我正在尝试将其合并到我的主页中。我很感激帮助。

<div id="myCarousel" class="carousel">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="active item">
<img src="assets/images/pic1.jpg" alt></div>
<div class="item">
<img src="assets/images/pic2.jpg" alt></div>
<div class="item">
<img src="assets/images/pic3.jpg" alt></div>
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div>
4

2 回答 2

0

I ran into the same problem of not having the images show up and I believe it has to due with the naming of each jpg file. In my HTML the image tags were pointing to pic.jpg but on my webhost, the files were named as pic.JPG and that actually makes a difference. So either rename it your html or the actual file and it should solve your problem.

于 2012-06-12T00:08:25.017 回答
0

而不是<img src="assets/images/pic1.jpg" alt>,您应该使用图像助手:

<%= image_tag 'pic1.jpg' %>

如果您的 pic1.jpg 在 app/assets/images 文件夹中,它将显示。

于 2012-05-28T17:19:16.497 回答