Template:Team:Edinburgh/Code
From 2013.igem.org
(Difference between revisions)
Hristianita (Talk | contribs) |
Hristianita (Talk | contribs) |
||
Line 286: | Line 286: | ||
$(function() { | $(function() { | ||
- | $(".gallery | + | $(".gallery img").css("display", "none"); |
- | if ($(".gallery | + | if ($(".gallery img")[gallery_active_id]) $(".gallery img")[gallery_active_id].style.display="block"; |
setInterval("changeGalleryPic()", 5000) ; | setInterval("changeGalleryPic()", 5000) ; | ||
Line 294: | Line 294: | ||
function changeGalleryPic() { | function changeGalleryPic() { | ||
gallery_active_id += 1; | gallery_active_id += 1; | ||
- | if (gallery_active_id >= $(".gallery | + | if (gallery_active_id >= $(".gallery img").length) gallery_active_id = 0; |
- | $(".gallery | + | $(".gallery img").css("display", "none"); |
- | if ($(".gallery | + | if ($(".gallery img")[gallery_active_id]) $(".gallery img")[gallery_active_id].style.display="block"; |
} | } | ||
Revision as of 21:24, 3 October 2013