Template:CSS/UT-Tokyo/Counter/Contents
From 2014.igem.org
(Difference between revisions)
Pineappler (Talk | contribs) |
Pineappler (Talk | contribs) |
||
Line 1: | Line 1: | ||
- | <html> | + | <html><head> |
- | <head> | + | |
<style type="text/css"> | <style type="text/css"> | ||
#contentSub, #footer-box, #catlinks, #search-controls, #p-logo, .printfooter, .visualClear, .firstHeading{ | #contentSub, #footer-box, #catlinks, #search-controls, #p-logo, .printfooter, .visualClear, .firstHeading{ | ||
Line 300: | Line 299: | ||
overflow:hidden; | overflow:hidden; | ||
height:1550px; | height:1550px; | ||
+ | } | ||
+ | #pageContents p{ | ||
+ | font-size:16px; | ||
+ | } | ||
+ | |||
+ | #pageContents h3{ | ||
+ | color:#000; | ||
+ | padding-left:40px; | ||
+ | font-size:30px; | ||
+ | margin-bottom:-10px; | ||
} | } | ||
#contentsBody #pageContents p{ | #contentsBody #pageContents p{ | ||
Line 440: | Line 449: | ||
} | } | ||
- | function loadContent(cont){ | + | function loadContent(cont,link,height){ |
document.title = "σ-Re Counter | UT-Tokyo 2014"; | document.title = "σ-Re Counter | UT-Tokyo 2014"; | ||
+ | |||
+ | var op = cont.replace("-block",""); | ||
+ | var opNode = document.getElementById(op); | ||
+ | |||
+ | if(opNode.childNodes[0].childNodes[0].src.indexOf("open") == -1){ | ||
+ | open(op); | ||
+ | } | ||
var node = document.getElementById("pageContents"); | var node = document.getElementById("pageContents"); | ||
for(var i = 0;i < node.childNodes.length; i++){ | for(var i = 0;i < node.childNodes.length; i++){ | ||
Line 455: | Line 471: | ||
var str = window.location.search.substring(1,window.location.search.length); | var str = window.location.search.substring(1,window.location.search.length); | ||
}else{ | }else{ | ||
- | var str = "Project- | + | var str = "Project-block"; |
} | } | ||
} | } | ||
+ | |||
+ | if(str == "Project-block"){ | ||
+ | var box = document.getElementsByClassName("pageContentsBox"); | ||
+ | var pc = document.getElementById("pageContents"); | ||
+ | box[0].style.height = "3000px"; | ||
+ | pc.style.height = "2950px"; | ||
+ | } | ||
+ | |||
var node = document.getElementById(str); | var node = document.getElementById(str); | ||
node.style.display = "block"; | node.style.display = "block"; | ||
+ | if(link){ | ||
+ | var href = "#" + link; | ||
+ | var target = $(href); | ||
+ | $("#contentsBody").mCustomScrollbar("scrollTo",target); | ||
+ | }else{ | ||
+ | $("#contentsBody").mCustomScrollbar("scrollTo","top"); | ||
+ | } | ||
+ | var team = document.getElementById("Team-top"); | ||
+ | if(team.style.display != "none"){ | ||
- | + | $('#isotope').isotope({ | |
- | + | itemSelector: '.element-item', | |
- | + | layoutMode:'packery' | |
- | + | }); | |
- | + | ||
- | + | var node = document.getElementById("isotope"); | |
- | + | var divs = new Array(); | |
- | + | var count = 0; | |
- | + | ||
- | + | for(var i = 0;i<node.childNodes.length;i++){ | |
- | + | if(node.childNodes[i].nodeType == 1){ | |
- | + | divs[count] = node.childNodes[i]; | |
- | + | count++; | |
+ | } | ||
} | } | ||
- | + | ||
- | + | for(var i = 0;i<divs.length;i++){ | |
- | + | divs[i].onclick = function(){ | |
- | + | var det = this.getElementsByClassName("detail"); | |
- | + | if(det[0]){ | |
- | + | if(det[0].style.display != "block"){ | |
- | + | var check = this.getElementsByClassName("thumbnail"); | |
- | + | if(check[0]){ | |
- | + | var flag = false; | |
- | + | if(check[0].style.display != "none"){ | |
- | + | flag = true; | |
- | + | } | |
} | } | ||
- | |||
- | |||
- | |||
- | + | var nodes = document.getElementsByClassName("detail") | |
- | + | ||
- | + | for(var j = 0;j<nodes.length;j++){ | |
- | + | nodes[j].style.display = "none"; | |
- | + | } | |
- | + | var nodes = document.getElementsByClassName("thumbnail") | |
- | + | ||
- | + | for(var j = 0;j<nodes.length;j++){ | |
- | + | nodes[j].style.display = "block"; | |
- | + | } | |
- | + | var thumb = this.getElementsByClassName("thumbnail"); | |
- | + | ||
- | + | if(det[0]){ | |
- | + | if(flag){ | |
+ | det[0].style.display = "block"; | ||
+ | thumb[0].style.display = "none"; | ||
+ | } | ||
} | } | ||
} | } | ||
} | } | ||
+ | |||
+ | $('#isotope').isotope({ | ||
+ | itemSelector: '.element-item', | ||
+ | layoutMode:'packery' | ||
+ | }); | ||
} | } | ||
- | |||
- | |||
- | |||
- | |||
- | |||
} | } | ||
- | + | var node = document.getElementsByClassName("closebutton"); | |
- | + | for(var i = 0;i<node.length;i++){ | |
- | + | node[i].onclick = function(e){ | |
- | + | var par = this.parentNode.parentNode.parentNode; | |
- | + | var det = par.getElementsByClassName("detail"); | |
- | + | var thumb = par.getElementsByClassName("thumbnail"); | |
- | + | if(det[0]){ | |
- | + | det[0].style.display = "none"; | |
- | + | } | |
- | + | if(thumb[0]){ | |
+ | thumb[0].style.display = "block"; | ||
+ | } | ||
+ | $('#isotope').isotope({ | ||
+ | itemSelector: '.element-item', | ||
+ | layoutMode:'packery' | ||
+ | }); | ||
+ | e.stopPropagation(); | ||
+ | e.cancelBubble = true; | ||
} | } | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
} | } | ||
} | } | ||
- | |||
} | } | ||
</script> | </script> | ||
Line 554: | Line 585: | ||
<script> | <script> | ||
$(window).load(function() { | $(window).load(function() { | ||
- | $("#contentsBody").mCustomScrollbar(); | + | $("#contentsBody").mCustomScrollbar({ |
+ | mouseWheelPixels: 250 | ||
+ | }); | ||
}); | }); | ||
$(window).load( function() { | $(window).load( function() { |