圖像滑塊問題 其實我在jquery.My目的初學者是創建一個光輝的形象slider.I已經使用jQuery從很多創建圖像滑塊教程。不能使用jQuery移動我的形象的權利(圖像滑塊)
代碼部分 slider.js
$(document).ready(function(){
$(".slider li:first-child").addClass("active");
setTimeout(autoAddClass, 5000);
$('.next').click(function() {
nextslide();
});
$('.previous').click(function() {
previousslide();
});
});
function nextslide()
{
$('.slider li:first-child').hide('slide', {direction: 'left'}, 1000);
//$('.slider li:first-child').fadeOut().next().fadeIn().end().appendTo('.slider');
}
function previousslide(){
$('.slider li:first-child').fadeOut();
$('.slider li:last-child').prependTo('.slider').fadeOut();
$('.slider li:first-child').fadeIn();
setTimeout(autoAddClass, 5000);
}
function autoAddClass(){
var next = $(".active").removeClass("active").next();
if(next.length)
$(next).addClass('active');
else
$('.slider li:first-child').addClass('active');
setTimeout(autoAddClass, 5000);
}
*{
margin: 0;
padding: 0;
}
.full_width{
/*display: inline-block;*/
display: block;
width: 100%;
}
.full_width.language_header{
height: 50px;
background-color:#000;
/*margin-bottom: -5px;*/
}
.full_width.slider_header{
height: 600px;
background-color:#fff;
/*margin-bottom: -5px;*/
overflow: hidden;
}
.main_content{
/*display: inline-block;*/
display: block;
\t width:100%;
\t float:left;
}
.wrapper{
margin: 0 auto;
max-width: 1125px;
width: 100%;
}
.main_slider{
width: 100%;
float: left;
}
.active{
display: block;
}
ul{
list-style: none;
}
li{
display: block;
display: none;
}
.previous{
color: #000;
}
.next{
color: #000;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<div class="full_width slider_header">
<div class="wrapper">
<div class="main_content">
<div class="main_slider">
<a href="javascript:;" class="previous"> Previous </a>
<a href="#" class="next">Next </a>
<ul class="slider">
<li><img height="100%" width="100%" alt="#Welcome" src="img/pic1.jpg"></li>
<li><img height="100%" width="100%" alt="#Welcome" src="img/pic3.jpg"></li>
<li><img height="100%" width="100%" alt="#Welcome" src="img/pic2.jpg"></li>
<li><img height="100%" width="100%" alt="#Welcome" src="img/pic4.jpg"></li>
<li><img height="100%" width="100%" alt="#Welcome" src="img/pic5.jpg"></li>
</ul>
</div>
問題是,當我點擊下一個透水按鈕(從屏幕截圖)第一圖像將移動到右第二個是負載。我目前沒有發生,請幫忙。
小提琴請.. – 2015-02-10 09:55:09
@CerlinBoss我不知道如何使用小提琴 – 2015-02-10 09:55:54
嘗試重新在[這裏](http://jsfiddle.net/)網站 – 2015-02-10 09:58:04