I needed a simple three slides slider, so instead of using a jQ plugin I hand coded it myself. The code works but the animation occurs in 2-3 frames instead of happening in over 20 frames, except when in IE6 & IE7 where it animates perfectly in 20-30 frames. In all the other browsers(IE8, Firefox, Chrome, Safari, Opera) it animates in a motion which seems like the computer is hanging. If anyone knows why this is happening please lemme know. I don't wanna use a bulky plugin and then style it too.
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");
});