【发布时间】:2013-06-11 09:46:09
【问题描述】:
我已经发布了与此问题相关的帖子,我无法得到答案。我需要的是带有下一个的基于文本的连续水平滑块,上一个选项没有滑块,现在我尝试自己的新滑块,现在我的问题是如何使下一个,在我的代码之前。我的滑块代码在下面
(function($) {
$.fn.jslider = function(options){
var config = {
speed : 1000,
pause : 2000,
transition : 'fade'
},
options = $.extend(config,options);
this.each(function(){
var $this = $(this);
$this.wrap('<div class="slider_content" />');
$this.css({
'width':'4440px',
'position':'relative',
'padding':'0'
});
if(options.transition === 'slide'){
$this.children().css({
'float' : 'left',
'list-style' : 'none'
});
$('.slider_content').css({
'width': $this.children().width(),
'overflow':'hidden'
});
slide()
}
function slide(){
setInterval(function(){
$this.animate({'left':'-'+ $this.parent().width()},options.speed,function(){
$this
.css('left',0)
.children(':first')
.appendTo($this);
})
},options.pause);
}
//Sider Function end
});
}
})(jQuery);
我的 HTML 是
<div class='prev'>test</div>
<div class="slider_capsule">
<ul class="slider">
<li> 1 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever</li>
<li> 2 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever</li>
<li> 3 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever</li>
<li> 4 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever</li>
<li> 5 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever</li>
</ul>
</div>
</div>
如何在这段代码中添加下一个和上一个?
【问题讨论】:
-
你能加个jsfiddle.net
-
jsfiddle.net/srrMA 但在 jsfiddle 中无法正常工作。
-
你需要将 jslider 插件添加到你的 jsfiddle 中的外部资源
-
对不起,我只是粘贴了我使用的代码。请帮助我。
-
把jslider插件的链接粘贴到这里
标签: javascript jquery html next