2

我一直试图解决这个问题。任何建议/修复将不胜感激!

来源:我的来源

问题:字幕不显示

html(用于轨道滑块):

<div><img class="art-work" src="art/2.png" alt="" data-caption="#htmlCaption1" /></div>
<div><img class="art-work" src="art/3.png" alt="" data-caption="#htmlCaption2" /></div>
<div><img class="art-work" src="art/4.png" alt="" data-caption="#htmlCaption3" /></div>

....等等

html(用于轨道滑块标题):

<span class="orbit-caption" id="htmlCaption1">Art #1</span>
<span class="orbit-caption" id="htmlCaption2">Art #2</span>
<span class="orbit-caption" id="htmlCaption3">Art #3</span>

...等等

html中的js:

<script type="text/javascript">
   $(window).load(function() {
        $('#featured').orbit({
            bullets: true,
            timer: false,
            captions: true,
            animation: 'fade' 
        });
   });
</script>   
4

1 回答 1

3

这是因为您在“img”标签中拥有“data-caption”属性,而不是包装它的“div”。将其更改为以下内容,它应该可以工作

<div data-caption="#htmlCaption1"><img class="art-work" src="art/2.png" alt="" /></div>
于 2012-09-10T15:27:11.990 回答