我无法改变滑块的行为:
继承人html:
<div class="media">
<div class="slideButtons">
<span class="prev"><</span>
<span class="next">/ ></span>
</div>
<ul class="gallery" id="olympGallery">
<li></li>
<li></li>
<li>.</li>
</ul>
</div>
继承人js:
<script>
var speed = 200;
$(".prev").click(function() {
var now = $(this).parent().next("ul.gallery").children(":visible"),
last = $(this).next("ul.gallery").children(":last"),
prev = now.prev();
prev = prev.index() == -1 ? last : prev;
now.fadeOut(speed, function() {prev.fadeIn(speed);});
});
$(".next").click(function() {
var now = $(this).parent().next("ul.gallery").children(':visible'),
first = $(this).parent().next("ul.gallery").children(':first'),
next = now.next();
next = next.index() == -1 ? first : next;
now.fadeOut(speed, function() {next.fadeIn(speed);});
});
$(".gallery li").click(function() {
var first = $(this).parent().children(':first'),
next = $(this).parent().next();
next = next.index() == -1 ? first : next;
$(this).fadeOut(speed, function() {next.fadeIn(speed);});
});
</script>
所以问题在于,当我尝试重新定位控件时,它会在下面杀死脚本并且不会在点击时滑过。另一个问题是,如果我点击左侧导航,它也会杀死脚本,但前提是你在页面加载后点击了幻灯片1。
所以我需要将控件移动到容器的任一侧而不会杀死脚本 - 添加自动滑动功能并修复那个小错误 - 任何想法的人?
我试过浮动控件 - 我尝试使用控件查找自动滚动但无法让这个简单的滑块工作,而不是正常状态......