Team:Heidelberg/DesignTest
From 2013.igem.org
(Difference between revisions)
JuliaS1992 (Talk | contribs) m |
JuliaS1992 (Talk | contribs) (First Slider draft) |
||
Line 4: | Line 4: | ||
<html> | <html> | ||
- | + | <!-- Beginning of Slider --> | |
- | <!-- | + | |
- | + | <script> | |
- | + | var Slider = function() {this.initialize.apply(this, arguments)} | |
- | + | Slider.prototype = { | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
+ | initialize: function(slider) { | ||
+ | this.ul = slider.children[0] | ||
+ | this.li = this.ul.children | ||
+ | |||
+ | // make <ul> as large as all <li>’s | ||
+ | this.ul.style.width = (this.li[0].clientWidth * this.li.length) + 'px' | ||
+ | |||
+ | this.currentIndex = 0 | ||
+ | }, | ||
+ | goTo: function(index) { | ||
+ | // circel through indices | ||
+ | if (index < 0) index = this.li.length - 1; | ||
+ | else if (index > this.li.length - 1) index = 0; | ||
+ | // move <ul> left | ||
+ | this.ul.style.left = '-' + (100 * index) + '%' | ||
+ | |||
+ | this.currentIndex = index | ||
+ | }, | ||
+ | goToPrev: function() { | ||
+ | this.goTo(this.currentIndex - 1) | ||
+ | }, | ||
+ | goToNext: function() { | ||
+ | this.goTo(this.currentIndex + 1) | ||
+ | } | ||
+ | } | ||
+ | </script> | ||
- | + | <div id="SliderWrap"> | |
- | + | <div id="SliderPrev"><a href="#" onclick="sliderMain.goToPrev();return(false);"><</a></div><!-- | |
- | + | --><div id="Slider"> | |
- | + | <ul id="SliderUl"> | |
- | + | ||
- | + | <li> | |
- | + | <div> | |
+ | <h2>Link to Project Page</h2> | ||
</div> | </div> | ||
- | + | </li> | |
- | + | <li> | |
- | <li | + | <div> |
- | + | <h2>We did lot's of funny stuff</h2> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
</div> | </div> | ||
- | + | </li> | |
- | + | <li> | |
- | <li | + | <div> |
- | + | <h2>And we want to thank all our sponsors!</h2> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
</div> | </div> | ||
- | + | </li> | |
- | + | ||
- | + | </ul> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | </div><!-- | |
- | + | --><div id="SliderNext"><a href="#" onclick="sliderMain.goToNext();return(false);">></a></div> | |
</div> | </div> | ||
+ | <script> | ||
+ | var sliderMain = new Slider(document.getElementById("Slider")); | ||
+ | window.setInterval("sliderMain.goToNext()", 2500); | ||
+ | </script> | ||
+ | <style type="text/css"> | ||
+ | #SliderWrap { | ||
+ | width:80%; | ||
+ | } | ||
+ | #Slider, #SliderNext, #SliderPrev { | ||
+ | display:inline-block; | ||
+ | vertical-align:middle; | ||
+ | background-color:#aaa; | ||
+ | } | ||
+ | #SliderNext a, #SliderPrev a { | ||
+ | text-decoration:none; | ||
+ | font-weight:bold; | ||
+ | font-size:150%; | ||
+ | } | ||
+ | #SliderNext, #SliderPrev { | ||
+ | width:1.5em; | ||
+ | text-align:center; | ||
+ | } | ||
+ | #SliderNext { | ||
+ | border-top-right-radius:1em; | ||
+ | border-bottom-right-radius:1em; | ||
+ | } | ||
+ | #SliderPrev { | ||
+ | border-top-left-radius:1em; | ||
+ | border-bottom-left-radius:1em; | ||
+ | } | ||
+ | #Slider { | ||
+ | overflow:hidden; | ||
+ | width:40em; | ||
+ | height:14em; | ||
+ | display:auto; | ||
+ | border:1px solid #aaa; | ||
+ | border-radius:0.5em; | ||
+ | } | ||
+ | #SliderUl { | ||
+ | list-style:none; | ||
+ | position:relative; | ||
+ | margin:0px; | ||
+ | padding:0px; | ||
+ | } | ||
+ | #SliderUl li { | ||
+ | float:left; | ||
+ | width:40em; | ||
+ | height:14em; | ||
+ | } | ||
+ | #SliderUl img, #SliderUl div { | ||
+ | height:100%; | ||
+ | } | ||
+ | </style> | ||
- | <!-- | + | <!-- End of Slider --> |
Find all templates used on <a href="https://2013.igem.org/Team:Heidelberg/Templates">the templates page</a> with coresponding explanations.<br /> | Find all templates used on <a href="https://2013.igem.org/Team:Heidelberg/Templates">the templates page</a> with coresponding explanations.<br /> |
Revision as of 12:20, 2 September 2013
Find all templates used on the templates page with coresponding explanations.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Philosophers StoneLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.Philosophers StoneLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.Philosophers StoneLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. |
Philosophers StoneLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.Philosophers StoneLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.Philosophers StoneLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. |
Philosophers StoneLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.Philosophers StoneLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.Philosophers StoneLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. |