我正在使用轨道的幻灯片放映要求,但我不能添加标题。
文档是这样写的:
<div id="featured">
<img src="overflow.jpg" alt="Overflow: Hidden No More" />
<img src="captions.jpg" alt="HTML Captions" data-caption="#htmlCaption" />
<img src="features.jpg" alt="and more features" />
</div>
<!-- Captions for Orbit -->
<span class="orbit-caption" id="htmlCaption">I'm A Badass Caption</span>我正在使用haml,并像这样做:
.container
.row
.two.columns
=render "left_navigation"
.ten.columns.destination_tabs
.contianer
.row
.ten.columns
%h3 Featured Destination
%hr
-if @preferred.blank?
%h5 No Featured destinations currently
-else
#featured
-@preferred.each do |destination|
-destination.destination_photos.each do |photo|
=image_tag(photo.picture.thumb_large.url, :alt =>"html captions", :data-caption => "#htmlCaption")
.orbit-caption#htmlCaption
="sfsdf"这显然给出了错误,因为我不能给出像:data-caption这样的语法,我尝试了很多东西,但都不能正确,有人能帮我吗?
发布于 2012-03-17 01:03:26
您可以使用任意字符串作为符号,只需简单地将它们引起来:
:"data-caption" => "#htmlCaption" #note the quotes around data-captionhttps://stackoverflow.com/questions/9716964
复制相似问题