From 2014.igem.org
(Difference between revisions)
|
|
Line 89: |
Line 89: |
| | | |
| </td></tr> | | </td></tr> |
- |
| |
- | <html>
| |
- | <head>
| |
- | <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
| |
- | <title>Slide Show</title>
| |
- | <style type="text/css">
| |
- | body {
| |
- | text-align: center;
| |
- | margin: 0;
| |
- | padding: 0;
| |
- | }
| |
- |
| |
- | #imageContainer {
| |
- | min-height: 550px;
| |
- | background-color: lightblue;
| |
- |
| |
- | }
| |
- |
| |
- | a {
| |
- | text-decoration: none;
| |
- | padding: 5px;
| |
- | color: #333;
| |
- | }
| |
- | </style>
| |
- |
| |
- | <script type="text/javascript">
| |
- |
| |
- | var imgSlide;
| |
- | var pic = 0;
| |
- | window.onload = function ()
| |
- | {
| |
- |
| |
- | imgSlide = document.getElementById('img');
| |
- |
| |
- | // preload images
| |
- | images = new Array();
| |
- | images[0] = new Image();
| |
- | images[0].src = "http://s8.photobucket.com/user/mtguinn/embed/slideshow/iGEMhomePage"
| |
- | images[1] = new Image();
| |
- | images[1].src = "waterfall-1.jpg";
| |
- | images[2] = new Image();
| |
- | images[2].src = "waterfall-2.jpg";
| |
- | images[3] = new Image();
| |
- | images[3].src = "waterfall-3.png";
| |
- |
| |
- | }
| |
- |
| |
- | function slide()
| |
- | {
| |
- | imgSlide.src = images[pic].src;
| |
- | if(pic < 3) // images.length - 1 can be used here
| |
- | {
| |
- | pic++;
| |
- | }
| |
- | else
| |
- | {
| |
- | pic = 0
| |
- |
| |
- | }
| |
- | timer = setTimeout(slide, 5000);
| |
- | }
| |
- |
| |
- | function prev()
| |
- | {
| |
- | if(timer)
| |
- | stopSlide();
| |
- |
| |
- | if(pic == 0)
| |
- | {
| |
- |
| |
- | pic = 3;
| |
- |
| |
- | imgSlide.src = images[pic].src;
| |
- | }
| |
- | else
| |
- | {
| |
- | pic--;
| |
- | imgSlide.src = images[pic].src;
| |
- | }
| |
- | }
| |
- |
| |
- | function next()
| |
- | {
| |
- | if(timer)
| |
- | stopSlide();
| |
- |
| |
- | if(pic == 3)
| |
- | {
| |
- |
| |
- | pic = 0;
| |
- | imgSlide.src = images[pic].src;
| |
- | }
| |
- | else
| |
- | {
| |
- | pic++;
| |
- | imgSlide.src = images[pic].src;
| |
- | }
| |
- |
| |
- |
| |
- | }
| |
- |
| |
- | function stopSlide()
| |
- | {
| |
- | clearTimeout(timer);
| |
- | }
| |
- |
| |
- |
| |
- | </script>
| |
- | </head>
| |
- |
| |
- | <body>
| |
- | <div id="imageContainer"><img id="img" src="waterfall-0.jpg" alt="image" title="image"/></div>
| |
- | <a href="JavaScript:slide()" title="Start">Start</a><a href="JavaScript:next()" title="Next">Next</a><a href="JavaScript:prev()" title="Previous">Previous</a><a href="JavaScript:stopSlide()" title="Stop">Stop</a>
| |
- |
| |
- | </body>
| |
- | </html>
| |
Revision as of 14:17, 23 September 2014
|
|
|
|
History of Cholera |
Project |
Cholera is a terrible thing.
|
More about our project:
|