Team:UCLA/Template/Javascript

From 2014.igem.org

(Difference between revisions)
Line 70: Line 70:
</script>
</script>
 +
<script type="text/javascript">
 +
</script>
 +
function Slider(){
 +
$(".slider #1").show("fade",500);
 +
$(".slider #1").delay(5500).hide("slide",{direction:'left'},500);
 +
 +
var sc = $(".slider img").size();
 +
var count = 2;
 +
 +
setInterval(function(){
 +
$(".slider #"+count).show("slide",{direction:'right'},500);
 +
$(".slider #"+count).delay(5500).hide("slide",{direction:'left'},500);
 +
if(count == sc){
 +
count = 1;
 +
}else{
 +
count += 1;
 +
}
 +
},6500);
 +
}
</html>
</html>

Revision as of 09:50, 24 July 2014

function Slider(){ $(".slider #1").show("fade",500); $(".slider #1").delay(5500).hide("slide",{direction:'left'},500); var sc = $(".slider img").size(); var count = 2; setInterval(function(){ $(".slider #"+count).show("slide",{direction:'right'},500); $(".slider #"+count).delay(5500).hide("slide",{direction:'left'},500); if(count == sc){ count = 1; }else{ count += 1; } },6500); }