Difference between revisions of "Template:ETH Zurich"

m
Line 5: Line 5:
 
<link rel="stylesheet" type="text/css" href="https://2015.igem.org/Template:ETH_Zurich/template.css?action=raw&ctype=text/css" />
 
<link rel="stylesheet" type="text/css" href="https://2015.igem.org/Template:ETH_Zurich/template.css?action=raw&ctype=text/css" />
  
<script type="text/javascript" src="https://2015.igem.org/Template:ETH_Zurich/template.js?action=raw&ctype=text/javascript"></script>
 
 
<!--<script type="text/javascript" src="https://2015.igem.org/Template:ETH_Zurich/progress.js?
 
action=raw&ctype=text/javascript"></script>-->
 
<!--<script type="text/javascript" src="https://2015.igem.org/Template:ETH_Zurich/injectHTML.js?action=raw&ctype=text/javascript"></script>-->
 
 
<!--<script type="text/javascript" src="https://2015.igem.org/common/MathJax-2.5-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>-->
 
<!--<script type="text/javascript" src="https://2015.igem.org/common/MathJax-2.5-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>-->
<!--<script type="text/javascript" src="https://2015.igem.org/Template:ETH_Zurich/scroll_highlight.js?action=raw&ctype=text/javascript"></script>-->
 
<!--<script type="text/javascript" src="https://2015.igem.org/Template:ETH_Zurich/getElements.js?action=raw&ctype=text/javascript"></script>-->
 
  
<!--
+
<script type="text/javascript" src="https://2015.igem.org/Template:ETH_Zurich/template.js?action=raw&ctype=text/javascript"></script>
<script type="text/javascript">
+
(function () {
+
  var script = document.createElement("script");
+
  script.type = "text/javascript";
+
  script.src = "https://2015.igem.org/common/MathJax-2.5-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
+
  document.getElementsByTagName("head")[0].appendChild(script);
+
})();
+
</script>
+
 
+
<script type="text/javascript">
+
function expand(obj) {
+
 
+
if (getStyle(obj.parentElement,'max-height') == "999999px") {
+
    obj.parentElement.style.maxHeight = "70px";
+
    obj.getElementsByTagName('img')[0].style.backgroundPosition = "0px 0px";
+
    obj.parentElement.style.paddingBottom = "0px";
+
} else {
+
    obj.parentElement.style.maxHeight = "999999px";
+
    obj.getElementsByTagName('img')[0].style.backgroundPosition = "0px 24px";
+
    obj.parentElement.style.paddingBottom = "35px";
+
}
+
 
+
}
+
 
+
$(document).ready(function(){
+
 
+
var menu = document.getElementById('sidemenu');
+
var items = $("#contentContainer h1,h2,h3,h4,h5,h6, .expContainer h1,h2,h3,h4,h5,h6");
+
var menuText = "";
+
 
+
if (items.length > 2) {
+
var cur = 0,next=0,count=0;
+
for (i=1; i<items.length; i++) {
+
next = parseInt(items[i].tagName.substring(1,2));
+
if (next > cur) {
+
menuText = menuText.concat("<ul>");
+
count = count + 1;
+
}
+
if (next < cur) {
+
menuText = menuText.concat("</ul>");
+
count = count - 1;
+
}
+
var itemtext = items[i].textContent.replace(/\W/g,'_');
+
items[i].id=itemtext;
+
cur = next;
+
menuText = menuText.concat("<li>");
+
menuText = menuText.concat("<a class=\"\" href=\"#");
+
menuText = menuText.concat(itemtext);
+
menuText = menuText.concat("\">");
+
menuText = menuText.concat(items[i].textContent);
+
menuText = menuText.concat("</a></li>");
+
}
+
 
+
while (count) {
+
menuText = menuText.concat("</ul>");
+
count = count - 1;
+
}
+
 
+
}
+
if (menuText == "") {
+
menuText = menuText.concat("<i>\"What I cannot create I do not understand.\"</i><br> - Richard Feynmann");
+
}
+
menu.innerHTML += menuText;
+
menu.style.display = "block";
+
 
+
var items = getElementsByClass('imgBox');
+
 
+
for (var i=0;i<items.length;i++) {
+
var curLink = items[i].getElementsByTagName('a')[0];
+
var boxIns = "<div id=\"mag\"><a href=\"";
+
boxIns = boxIns.concat(curLink.href);
+
boxIns = boxIns.concat("\"><img src=\"https://2015.igem.org/wiki/skins/common/images/magnify-clip.png\"></a></div>");
+
items[i].innerHTML += boxIns;
+
}
+
 
+
 
+
 
+
});
+
 
+
$(function(){ // document ready
+
var ht = getStyle(document.getElementById('topContainer'),'height');
+
document.getElementById('sideFiller').style.height = ht;
+
  if (!!$('#sidemenu').offset()) { // make sure ".sticky" element exists
+
    var stickyTop = $('#sidemenu').offset().top; // returns number
+
    $(window).scroll(function(){ // scroll event
+
      var windowTop = $(window).scrollTop(); // returns number
+
      if (stickyTop < windowTop + 50){
+
        $('#sidemenu').css({ position: 'fixed', top: '50px' , width: '12%'});
+
      }
+
      else {
+
        $('#sidemenu').css({ position: 'absolute', top: ht , width: '12%'});
+
      }
+
    });
+
  }
+
});
+
 
+
</script>
+
 
+
<script type="text/javascript">
+
/* Used to change style using jQuery based on browser size */
+
function adjustStyle(width) {
+
  width = parseInt(width);
+
if (width < 1215) {
+
$('#sidemenuContainer').css('display','none');
+
$('#mainContainer').css('width','initial');
+
$('#menuContainer a').css('font-size','40px');
+
$('#menuContainer li').css({'float':'clear','width':'440px','height':'60px'});
+
$('#menuContainer li ul').css({'width':'440px','margin-top':'30px','float':'right','position':'absolute'});
+
/*$('#menuContainer li.sub').css('border-radius','20px 0px 0px 20px');*/
+
/*$('#menuContainer li ul').css({'width':'440px','margin-left':'440px','margin-top':'-29px','float':'right','position':'absolute','border-radius':'0px 20px 20px 20px'});*/
+
} else {
+
$('#sidemenuContainer').removeAttr('style');
+
$('#menuContainer li').removeAttr('style');
+
$('#mainContainer').removeAttr('style');
+
$('#menuContainer li ul').removeAttr('style');
+
$('#menuContainer a').removeAttr('style');
+
$('#menuContainer li.sub').removeAttr('style');
+
}
+
}
+
  
$(function() {
 
  adjustStyle($(this).width());
 
  $(window).resize(function() {
 
    adjustStyle($(this).width());
 
  });
 
});
 
</script>
 
-->
 
  
 
<!-- Start of the template html elements. -->
 
<!-- Start of the template html elements. -->

Revision as of 06:13, 20 August 2015

We would like to thank our sponsors