Team:Brown-Stanford/Templates/Main
From 2011.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
+ | <!-- | ||
+ | |||
+ | Please link to our wiki and cite us if you like what you see and would like to use | ||
+ | any of the code used on our wiki. | ||
+ | |||
+ | -Brown-Stanford iGEM 2011 | ||
+ | |||
+ | --> | ||
+ | |||
__NOTOC__<html lang="en"> | __NOTOC__<html lang="en"> | ||
<head> | <head> | ||
Line 5: | Line 14: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
<!-- | <!-- | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
var slideshowSpeed = 20000; | var slideshowSpeed = 20000; | ||
- | |||
- | |||
- | |||
var photos = [ { | var photos = [ { | ||
"image" : "https://static.igem.org/mediawiki/2011/a/a1/Brown-Stanford_BG1.jpg", | "image" : "https://static.igem.org/mediawiki/2011/a/a1/Brown-Stanford_BG1.jpg", | ||
Line 29: | Line 29: | ||
} | } | ||
]; | ]; | ||
- | |||
- | |||
- | |||
$(document).ready(function() { | $(document).ready(function() { | ||
- | |||
var interval; | var interval; | ||
var activeContainer = 1; | var activeContainer = 1; | ||
Line 39: | Line 35: | ||
var animating = false; | var animating = false; | ||
var navigate = function(direction) { | var navigate = function(direction) { | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
if(direction == "next") { | if(direction == "next") { | ||
currentImg++; | currentImg++; | ||
Line 51: | Line 41: | ||
} | } | ||
} | } | ||
- | |||
- | |||
var currentContainer = activeContainer; | var currentContainer = activeContainer; | ||
if(activeContainer == 1) { | if(activeContainer == 1) { | ||
Line 59: | Line 47: | ||
activeContainer = 1; | activeContainer = 1; | ||
} | } | ||
- | |||
showImage(photos[currentImg - 1], currentContainer, activeContainer); | showImage(photos[currentImg - 1], currentContainer, activeContainer); | ||
- | |||
}; | }; | ||
Line 67: | Line 53: | ||
var showImage = function(photoObject, currentContainer, activeContainer) { | var showImage = function(photoObject, currentContainer, activeContainer) { | ||
animating = true; | animating = true; | ||
- | |||
- | |||
currentZindex--; | currentZindex--; | ||
- | |||
- | |||
$("#headerimg" + activeContainer).css({ | $("#headerimg" + activeContainer).css({ | ||
"background-image" : "url(" + photoObject.image + ")", | "background-image" : "url(" + photoObject.image + ")", | ||
Line 77: | Line 59: | ||
"z-index" : currentZindex | "z-index" : currentZindex | ||
}); | }); | ||
- | |||
- | |||
- | |||
$("#headerimg" + currentContainer).fadeOut(function() { | $("#headerimg" + currentContainer).fadeOut(function() { | ||
setTimeout(function() { | setTimeout(function() { | ||
Line 87: | Line 66: | ||
}; | }; | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
navigate("next"); | navigate("next"); | ||
- | |||
- | |||
interval = setInterval(function() { | interval = setInterval(function() { | ||
navigate("next"); | navigate("next"); | ||
}, slideshowSpeed); | }, slideshowSpeed); | ||
- | |||
}); | }); | ||
+ | |||
+ | /* | ||
+ | * Author: Marco Kuiper (http://www.marcofolio.net/) | ||
+ | */ | ||
+ | |||
--> | --> | ||
</script> | </script> | ||
Line 437: | Line 409: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(function() { | $(function() { | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
$('#sdt_menu > li').bind('mouseenter',function(){ | $('#sdt_menu > li').bind('mouseenter',function(){ | ||
var $elem = $(this); | var $elem = $(this); | ||
Line 457: | Line 422: | ||
'height':'170px', | 'height':'170px', | ||
'left':'0px' | 'left':'0px' | ||
- | }, | + | },200,'easeOutBack') |
.andSelf() | .andSelf() | ||
.find('.sdt_wrap') | .find('.sdt_wrap') |
Revision as of 21:29, 27 June 2011