シンプルな 3 枚のスライドのスライダーが必要だったので、jQ プラグインを使用する代わりに、自分で手動でコーディングしました。コードは機能しますが、20 ~ 30 フレームで完全にアニメーション化される IE6 および IE7 を除いて、アニメーションは 20 フレーム以上ではなく 2 ~ 3 フレームで発生します。他のすべてのブラウザー (IE8、Firefox、Chrome、Safari、Opera) では、コンピューターがハングしているように見える動きでアニメーション化されます。なぜこれが起こっているのか誰かが知っているなら、教えてください。かさばるプラグインを使用してスタイルを設定したくありません。
HTML:
<div class="fl-left" id="slide-box">
<div class="slide" id="slide-1">
<img src="images/slider/1.jpg" alt="The Image Description" />
<p class="slide-text">"The Description About The Image/Slide"</p>
</div>
<div class="slide" id="slide-2">
<img src="images/slider/1.jpg" alt="The Image Description" />
<p class="slide-text">"The Description About The Image/Slide"</p>
</div>
<div class="slide" id="slide-3">
<img src="images/slider/1.jpg" alt="The Image Description" />
<p class="slide-text">"The Description About The Image/Slide"</p>
</div>
</div>
CSS:
#slide-box{
position:relative;
width:472px;
height:192px;
border-bottom:3px solid #fff;
overflow:hidden;
}
.slide{ position:absolute;
float:left; width:455px;
overflow:hidden;
border:1px solid #000;
margin:8px 8px 0 8px;
}
.slide img{ float:left; }
.slide-text{ display:block;
width: 140px;
height:132px;
background:#ecefdc;
float:left;
padding: 10px 0px;
}
#slide-1 { left:0px; }
#slide-2 { left:467px; }
#slide-3 { left:934px; }
jQuery:
$('#slide-but-1').click(function(){
$('#slide-1').animate({"left": "0px"}, "slow");
$('#slide-2').animate({"left": "467px"}, "slow");
$('#slide-3').animate({"left": "934px"}, "slow");
});
$('#slide-but-2').click(function(){
$('#slide-1').animate({"left": "-467px"}, "slow");
$('#slide-2').animate({"left": "0px"}, "slow");
$('#slide-3').animate({"left": "467px"}, "slow");
});
$('#slide-but-3').click(function(){
$('#slide-1').animate({"left": "-934px"}, "slow");
$('#slide-2').animate({"left": "-467px"}, "slow");
$('#slide-3').animate({"left": "0px"}, "slow");
});