Слайдер
HTML
<div class="slider">
<div id="Blocks" style="" >
<div class ="Block" id = "1" style="background-color:red;">1</div>
<div class ="Block" id = "2" style="background-color:green;">2</div>
<div class ="Block" id = "3" style="background-color:Yellow;">3</div>
</div>
</div>
CSS
div.slider{
overflow:hidden;
width: 400px;
height:200px;
position: relative;
}
#Blocks{
position:absolute;
top: 0;
left:0;
width: 1200px;
height:200px;
}
div.Block {
width: 400px;
height:200px;
float: left;
}
JavaScript
$(function () {
(function go() {
$('#Blocks').delay(3000).animate({
left: '-=400'
}, 2000, function () {
$('.Block:first').appendTo($(this));
$(this).css({ left: 0});
go();
});
}());
});