jQuery n00b在这里,我使用jQuery插件scrollTo和localScroll来滚动特色区域中的元素,我无法弄清楚如何指定我想要开始的幻灯片。我的5个可滚动元素设置为“T”形,逆时针旋转了90度。所以基本上它看起来像这样:
1
245
3
<div id="showcase-content"> //height: 450px; width: 960px; overflow: hidden
<div id="showcase-content-wrapper"> //height: 1350px; width: 2860px; overflow: hidden
<div class="showcase-slide" id="slideOne"> //height:450px; width: 960px; clear:both
Slide 1
<a class="slide2" href='#slideTwo'>down</a>
</div>
<div class="showcase-slide" id="slideTwo"> //float:left
Slide 2
<a class="slide1" href='#slideOne'>up</a>
<a class="slide3" href='#slideThree'>down</a>
<a class="slide4" href='#slideFour'>right</a>
</div>
<div class="showcase-slide" id="slideFour"> //float: left
Slide 4
<a class="slide2" href='#slideTwo'>left</a>
<a class="slide5" href='#slideFive'>right</a>
</div>
<div class="showcase-slide" id="slideFive"> //float: left
Slide 5
<a class="slide4" href='#slideFour'>left</a>
</div>
<div class="showcase-slide" id="slideThree"> //clear: both
Slide 3
<a class="slide2" href='#slideTwo'>up</a>
</div>
</div>
</div>
我的jQuery看起来像这样:
$.localScroll({
target: '#showcase-content', // could be a selector or a jQuery object too.
queue:true,
duration:1000,
hash:false,
});
目前,幻灯片开始于幻灯片1,但我希望我的幻灯片开始在幻灯片4上,然后允许用户从那里导航。有什么想法吗?