使用 localScroll jQuery 插件修改起始幻灯片
jQuery n00b 这里,我使用 jQuery 插件scrollTo 和 localScroll 来滚动特色区域中的元素,但我无法弄清楚如何指定我想要开始的幻灯片。我的 5 个可滚动元素设置为已逆时针旋转 90 度的“T”形状。所以基本上看起来像这样:
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 开始,然后允许用户从那里导航。有什么想法吗?
jQuery n00b here, I'm using the jQuery plugin scrollTo and localScroll to scroll elements in a featured area and I'm having trouble figuring out how to specify the slide I want to start with. My 5 scrollable elements are set up in a "T" shape that has been rotated 90 degrees counter-clockwise. So basically it looks like this:
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>
My jQuery looks like this:
$.localScroll({
target: '#showcase-content', // could be a selector or a jQuery object too.
queue:true,
duration:1000,
hash:false,
});
Currently, the slideshow begins on Slide 1, however I would like my slideshow to begin on Slide 4 and then allow users to navigate from there. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论