Template:Team:MSOE
From 2013.igem.org
(Difference between revisions)
Vanhandelp (Talk | contribs) |
Vanhandelp (Talk | contribs) |
||
(36 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
+ | |||
<HTML xmlns="http://www.w3.org/1999/xhtml"> | <HTML xmlns="http://www.w3.org/1999/xhtml"> | ||
<HEAD> | <HEAD> | ||
- | + | <!---Some taken from iGEM home page --> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | ||
Line 13: | Line 14: | ||
</script> | </script> | ||
+ | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> | ||
+ | <script type="text/javascript"> | ||
+ | $(document).ready(function() { | ||
+ | //Show the paging and activate its first link | ||
+ | $(".paging").show(); | ||
+ | $(".paging a:first").addClass("active"); | ||
+ | |||
+ | //Get size of the image, how many images there are, then determin the size of the image reel. | ||
+ | var imageWidth = $(".window").width(); | ||
+ | var imageSum = $(".image_reel img").size(); | ||
+ | var imageReelWidth = imageWidth * imageSum; | ||
+ | |||
+ | //Adjust the image reel to its new size | ||
+ | $(".image_reel").css({'width' : imageReelWidth}); | ||
+ | |||
+ | //Paging and Slider Function | ||
+ | rotate = function(){ | ||
+ | var triggerID = $active.attr("rel") - 1; //Get number of times to slide | ||
+ | var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide | ||
+ | $(".paging a").removeClass('active'); //Remove all active class | ||
+ | $active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function) | ||
+ | |||
+ | //Slider Animation | ||
+ | $(".image_reel").animate({ | ||
+ | left: -image_reelPosition | ||
+ | }, 500 ); | ||
+ | }; | ||
+ | |||
+ | //Rotation and Timing Event | ||
+ | rotateSwitch = function(){ | ||
+ | play = setInterval(function(){ //Set timer - this will repeat itself every 7 seconds | ||
+ | $active = $('.paging a.active').next(); //Move to the next paging | ||
+ | if ( $active.length === 0) { //If paging reaches the end... | ||
+ | $active = $('.paging a:first'); //go back to first | ||
+ | } | ||
+ | rotate(); //Trigger the paging and slider function | ||
+ | }, 6000); //Timer speed in milliseconds (6 seconds) | ||
+ | }; | ||
+ | |||
+ | rotateSwitch(); //Run function on launch | ||
+ | |||
+ | //On Hover | ||
+ | //$(".image_reel a").hover(function() { | ||
+ | //clearInterval(play); //Stop the rotation | ||
+ | //}, function() { | ||
+ | //rotateSwitch(); //Resume rotation timer | ||
+ | //}); | ||
+ | |||
+ | //On Click | ||
+ | $(".pause a").click(function() { | ||
+ | clearInterval(play); //Stop the rotation | ||
+ | }); | ||
+ | |||
+ | |||
+ | //On Click | ||
+ | $(".paging a").click(function() { | ||
+ | $active = $(this); //Activate the clicked paging | ||
+ | //Reset Timer | ||
+ | clearInterval(play); //Stop the rotation | ||
+ | rotate(); //Trigger rotation immediately | ||
+ | rotateSwitch(); // Resume rotation timer | ||
+ | return false; //Prevent browser jump to link anchor | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
+ | <script type="text/javascript"> | ||
+ | $(document).ready(function() { | ||
+ | |||
+ | $(".main_image .desc").show(); //Show Banner | ||
+ | $(".main_image .block").animate({ opacity: 0.85 }, 1 ); //Set Opacity | ||
+ | $(".image_thumb ul li:first").addClass('active'); //Add the active class (highlights the very first list item by default) | ||
+ | $(".image_thumb ul li").click(function(){ | ||
+ | //Set Variables | ||
+ | var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image | ||
+ | var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL | ||
+ | var imgDesc = $(this).find('.block').html(); //Get HTML of the "block" container | ||
+ | var imgDescHeight = $(".main_image").find('.block').height(); //Find the height of the "block" | ||
+ | |||
+ | if ($(this).is(".active")) { //If the list item is active/selected, then... | ||
+ | return false; // Don't click through - Prevents repetitive animations on active/selected list-item | ||
+ | } else { //If not active then... | ||
+ | //Animate the Description | ||
+ | $(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() { //Pull the block down (negative bottom margin of its own height) | ||
+ | $(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 ); //swap the html of the block, then pull the block container back up and set opacity | ||
+ | $(".main_image img").attr({ src: imgTitle , alt: imgAlt}); //Switch the main image (URL + alt tag) | ||
+ | }); | ||
+ | } | ||
+ | //Show active list-item | ||
+ | $(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all list-items | ||
+ | $(this).addClass('active'); //Add class of 'active' on the selected list | ||
+ | return false; | ||
+ | |||
+ | }) .hover(function(){ //Hover effects on list-item | ||
+ | $(this).addClass('hover'); //Add class "hover" on hover | ||
+ | }, function() { | ||
+ | $(this).removeClass('hover'); //Remove class "hover" on hover out | ||
+ | }); | ||
+ | $("a.collapse").click(function(){ | ||
+ | $(".main_banner .block").slideToggle(); //Toggle the description (slide up and down) | ||
+ | $("a.collapse").toggleClass("show"); //Toggle the class name of "show" (the hide/show tab) | ||
+ | }); | ||
+ | });//Close Function | ||
+ | </script> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
Line 41: | Line 145: | ||
<style type="text/css"> | <style type="text/css"> | ||
- | + | /*--Slideshow Begins Here--*/ | |
+ | #slideshow { | ||
+ | display: block; | ||
+ | vertical-align: middle; | ||
+ | position: relative; | ||
+ | } | ||
+ | /*--Main Container--*/ | ||
+ | #main_view { | ||
+ | margin-left:auto; | ||
+ | margin-right:auto; | ||
+ | position: relative; | ||
+ | height:300px; width: 780px; | ||
+ | } | ||
+ | .window { | ||
+ | height:280px; width: 760px; | ||
+ | overflow: hidden; /*--Hides anything outside of the set width/height--*/ | ||
+ | position: absolute; | ||
+ | display: block; | ||
+ | top:50%; | ||
+ | left:50%; | ||
+ | margin: -140px 0 0 -380px; | ||
+ | } | ||
+ | .image_reel { | ||
+ | position: absolute; | ||
+ | top: 0; left: 0; | ||
+ | } | ||
+ | .image_reel img {float: left;} | ||
+ | .paging { | ||
+ | position: absolute; | ||
+ | bottom: 10px; right: 50px; | ||
+ | width: 300px; height:47px; | ||
+ | z-index: 100; /*--Assures the paging stays on the top layer--*/ | ||
+ | text-align: right; | ||
+ | line-height: 40px; | ||
+ | font-weight: bold; | ||
+ | background: url(paging_bg2.png) no-repeat; | ||
+ | display: none; /*--Hidden by default, will be later shown with jQuery--*/ | ||
+ | } | ||
+ | .paging a { | ||
+ | padding: 5px; | ||
+ | text-decoration: none; | ||
+ | color: #fff; text-shadow: #333 1px 1px 1px; | ||
+ | } | ||
+ | .pause { | ||
+ | position: absolute; | ||
+ | bottom: 10px; right: 20px; | ||
+ | width: 25px; height:47px; | ||
+ | z-index: 200; /*--Assures the paging stays on the top layer--*/ | ||
+ | text-align: center; | ||
+ | line-height: 40px; | ||
+ | font-weight: bold; | ||
+ | display: block; /*--Hidden by default, will be later shown with jQuery--*/ | ||
+ | } | ||
+ | .pause a { | ||
+ | padding: 5px; | ||
+ | text-decoration: none; | ||
+ | letter-spacing:1px; | ||
+ | font-weight: thick; | ||
+ | color: #f0f0f0; text-shadow: #333 1px 1px 1px; | ||
+ | border: 2px solid #ccc; | ||
+ | -moz-border-radius: 3px; | ||
+ | -khtml-border-radius: 3px; | ||
+ | -webkit-border-radius: 3px; | ||
+ | } | ||
+ | .paging a.active { | ||
+ | font-weight: bold; | ||
+ | border: 2px solid #fff; | ||
+ | -moz-border-radius: 3px; | ||
+ | -khtml-border-radius: 3px; | ||
+ | -webkit-border-radius: 3px; | ||
+ | } | ||
+ | .paging a:hover {font-weight: bold;} | ||
+ | /*--Slideshow Ends Here--*/ | ||
#content { | #content { | ||
Line 141: | Line 317: | ||
overflow: -moz-scrollbars-vertical !important; | overflow: -moz-scrollbars-vertical !important; | ||
resize: none; | resize: none; | ||
- | background: url() repeat; | + | background: url(https://static.igem.org/mediawiki/2013/f/fb/Bgtest.png) repeat; |
background-color: #fff; | background-color: #fff; | ||
} | } | ||
Line 180: | Line 356: | ||
body { | body { | ||
font: 65%/1.2 Arial, Helvetica, sans-serif; | font: 65%/1.2 Arial, Helvetica, sans-serif; | ||
- | background: url() repeat; | + | background: url(https://static.igem.org/mediawiki/2013/f/fb/Bgtest.png) repeat; |
background-color: #fff; } | background-color: #fff; } | ||
#wrap { | #wrap { | ||
Line 263: | Line 439: | ||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> | ||
- | |||
<script type="text/javascript"> | <script type="text/javascript"> | ||
+ | /* ------------------------------------------------------------------------ | ||
+ | s3Slider | ||
+ | |||
+ | Developped By: Boban Karišik -> http://www.serie3.info/ | ||
+ | CSS Help: Mészáros Róbert -> http://www.perspectived.com/ | ||
+ | Version: 1.0 | ||
+ | |||
+ | Copyright: Feel free to redistribute the script/modify it, as | ||
+ | long as you leave my infos at the top. | ||
+ | ------------------------------------------------------------------------- */ | ||
+ | |||
+ | |||
+ | (function($){ | ||
+ | |||
+ | $.fn.s3Slider = function(vars) { | ||
+ | |||
+ | var element = this; | ||
+ | var timeOut = (vars.timeOut != undefined) ? vars.timeOut : 4000; | ||
+ | var current = null; | ||
+ | var timeOutFn = null; | ||
+ | var faderStat = true; | ||
+ | var mOver = false; | ||
+ | var items = $("#" + element[0].id + "Content ." + element[0].id + "Image"); | ||
+ | var itemsSpan = $("#" + element[0].id + "Content ." + element[0].id + "Image span"); | ||
+ | |||
+ | items.each(function(i) { | ||
+ | |||
+ | $(items[i]).mouseover(function() { | ||
+ | mOver = true; | ||
+ | }); | ||
+ | |||
+ | $(items[i]).mouseout(function() { | ||
+ | mOver = false; | ||
+ | fadeElement(true); | ||
+ | }); | ||
+ | |||
+ | }); | ||
+ | |||
+ | var fadeElement = function(isMouseOut) { | ||
+ | var thisTimeOut = (isMouseOut) ? (timeOut/2) : timeOut; | ||
+ | thisTimeOut = (faderStat) ? 10 : thisTimeOut; | ||
+ | if(items.length > 0) { | ||
+ | timeOutFn = setTimeout(makeSlider, thisTimeOut); | ||
+ | } else { | ||
+ | console.log("Poof.."); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var makeSlider = function() { | ||
+ | current = (current != null) ? current : items[(items.length-1)]; | ||
+ | var currNo = jQuery.inArray(current, items) + 1 | ||
+ | currNo = (currNo == items.length) ? 0 : (currNo - 1); | ||
+ | var newMargin = $(element).width() * currNo; | ||
+ | if(faderStat == true) { | ||
+ | if(!mOver) { | ||
+ | $(items[currNo]).fadeIn((timeOut/6), function() { | ||
+ | if($(itemsSpan[currNo]).css('bottom') == 0) { | ||
+ | $(itemsSpan[currNo]).slideUp((timeOut/6), function() { | ||
+ | faderStat = false; | ||
+ | current = items[currNo]; | ||
+ | if(!mOver) { | ||
+ | fadeElement(false); | ||
+ | } | ||
+ | }); | ||
+ | } else { | ||
+ | $(itemsSpan[currNo]).slideDown((timeOut/6), function() { | ||
+ | faderStat = false; | ||
+ | current = items[currNo]; | ||
+ | if(!mOver) { | ||
+ | fadeElement(false); | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | } else { | ||
+ | if(!mOver) { | ||
+ | if($(itemsSpan[currNo]).css('bottom') == 0) { | ||
+ | $(itemsSpan[currNo]).slideDown((timeOut/6), function() { | ||
+ | $(items[currNo]).fadeOut((timeOut/6), function() { | ||
+ | faderStat = true; | ||
+ | current = items[(currNo+1)]; | ||
+ | if(!mOver) { | ||
+ | fadeElement(false); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | makeSlider(); | ||
+ | |||
+ | }; | ||
+ | |||
+ | })(jQuery); | ||
$(document).ready(function() { | $(document).ready(function() { | ||
$('#slider').s3Slider({ | $('#slider').s3Slider({ | ||
Line 275: | Line 547: | ||
#slider { | #slider { | ||
width: 970px; /* important to be same as image width */ | width: 970px; /* important to be same as image width */ | ||
- | height: | + | height: 250px; /* important to be same as image height */ |
position: relative; /* important */ | position: relative; /* important */ | ||
overflow: hidden; /* important */ | overflow: hidden; /* important */ | ||
Line 323: | Line 595: | ||
<li class="sliderImage"> | <li class="sliderImage"> | ||
<img src="https://static.igem.org/mediawiki/2013/c/c2/Bg1.png" alt="1" /> | <img src="https://static.igem.org/mediawiki/2013/c/c2/Bg1.png" alt="1" /> | ||
- | + | <span class = "top"><img src="https://static.igem.org/mediawiki/2013/c/c5/LogoV3.png" alt="1" /></SPAN> | |
- | |||
- | |||
- | |||
- | |||
</li> | </li> | ||
- | + | ||
</ul> | </ul> | ||
</div> | </div> | ||
- | + | <TABLE height = 80> | |
- | + | <TR> | |
- | + | <TD > | |
<a href="https://2013.igem.org/Team:MSOE_Milwaukee"><img src="https://static.igem.org/mediawiki/2013/e/e6/Home_BTN.png"></img></a> | <a href="https://2013.igem.org/Team:MSOE_Milwaukee"><img src="https://static.igem.org/mediawiki/2013/e/e6/Home_BTN.png"></img></a> | ||
+ | <TD > | ||
<a href="https://2013.igem.org/Team:MSOE_Milwaukee/Undergrads"><img src="https://static.igem.org/mediawiki/2013/6/6c/Team_BTN.png"></img></a> | <a href="https://2013.igem.org/Team:MSOE_Milwaukee/Undergrads"><img src="https://static.igem.org/mediawiki/2013/6/6c/Team_BTN.png"></img></a> | ||
+ | <TD > | ||
<a href="https://2013.igem.org/Team:MSOE_Milwaukee/Project"><img src="https://static.igem.org/mediawiki/2013/3/3b/Project_BTN.png"></img></a> | <a href="https://2013.igem.org/Team:MSOE_Milwaukee/Project"><img src="https://static.igem.org/mediawiki/2013/3/3b/Project_BTN.png"></img></a> | ||
+ | <TD > | ||
<a href="https://2013.igem.org/Team:MSOE_Milwaukee/Notebook"><img src="https://static.igem.org/mediawiki/2013/a/ab/Notebook_BTN.png"></img></a> | <a href="https://2013.igem.org/Team:MSOE_Milwaukee/Notebook"><img src="https://static.igem.org/mediawiki/2013/a/ab/Notebook_BTN.png"></img></a> | ||
+ | <TD > | ||
<a href="https://2013.igem.org/Team:MSOE_Milwaukee/Parts"><img src="https://static.igem.org/mediawiki/2013/2/26/Parts_BTN.png"></img></a> | <a href="https://2013.igem.org/Team:MSOE_Milwaukee/Parts"><img src="https://static.igem.org/mediawiki/2013/2/26/Parts_BTN.png"></img></a> | ||
+ | <TD > | ||
<a href="https://2013.igem.org/Team:MSOE_Milwaukee/Modeling"><img src="https://static.igem.org/mediawiki/2013/3/39/Modeling_BTN.png"></img></a> | <a href="https://2013.igem.org/Team:MSOE_Milwaukee/Modeling"><img src="https://static.igem.org/mediawiki/2013/3/39/Modeling_BTN.png"></img></a> | ||
+ | <TD > | ||
<a href="https://2013.igem.org/Team:MSOE_Milwaukee/Safety"><img src="https://static.igem.org/mediawiki/2013/6/6e/Safety_BTN.png"></img></a> | <a href="https://2013.igem.org/Team:MSOE_Milwaukee/Safety"><img src="https://static.igem.org/mediawiki/2013/6/6e/Safety_BTN.png"></img></a> | ||
+ | <TD > | ||
<a href="https://2013.igem.org/Team:MSOE_Milwaukee/Sponsors"><img src="https://static.igem.org/mediawiki/2013/f/f6/Sponsors_BTN.png"></img></a> | <a href="https://2013.igem.org/Team:MSOE_Milwaukee/Sponsors"><img src="https://static.igem.org/mediawiki/2013/f/f6/Sponsors_BTN.png"></img></a> | ||
+ | <TD width = 50 height = 80> | ||
+ | <a href="https://2013.igem.org"> | ||
+ | <IMG src="https://static.igem.org/mediawiki/2013/d/d2/IGemLogo.png" width = 75 height = 50></IMG></a> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | </BODY> | ||
</HTML> | </HTML> |
Latest revision as of 01:51, 29 July 2013