Difference between revisions of "Team:Glasgow/Practices"
Adele.cook (Talk | contribs) |
|||
Line 1: | Line 1: | ||
− | <html | + | {{GlasgowNavbar}} |
− | + | <html> | |
− | + | <head> | |
− | + | <script type="text/javascript" > | |
− | + | function menuFixed(id){ | |
− | + | var obj = document.getElementById(id); | |
− | + | var _getHeight = obj.offsetTop; | |
− | + | ||
− | + | window.onscroll = function(){ | |
+ | changePos(id,_getHeight); | ||
+ | } | ||
+ | } | ||
+ | function changePos(id,height){ | ||
+ | var obj = document.getElementById(id);var windowBottom = $(window).scrollTop() + $(window).innerHeight(); | ||
+ | var scrollTop = document.documentElement.scrollTop || document.body.scrollTop - 150; | ||
+ | var windowBottom = $(window).scrollTop() + $(window).innerHeight(); | ||
+ | var w = window.innerWidth; | ||
+ | if(w>=1024){ | ||
+ | if($(window).scrollTop() + $(window).height() > $(document).height() - 500){ | ||
+ | $('#sidebar').fadeOut("fast");}else{$('#sidebar').fadeIn("fast");} | ||
+ | } | ||
+ | if(scrollTop < height){ obj.style.position = 'relative'; | ||
+ | }else{ | ||
+ | obj.style.position = 'fixed'; | ||
+ | } | ||
+ | } | ||
+ | </script> | ||
− | + | <script type="text/javascript"> | |
− | + | window.onload = function(){ | |
− | + | menuFixed('sidebar'); | |
− | + | } | |
− | + | </script> | |
− | + | <script type="text/javascript"> | |
− | + | // 收缩展开效果 | |
− | + | $(document).ready(function(){ | |
− | + | // $(".box h5").toggle(function(){ | |
− | + | // $(this).next(".text").animate({height: 'toggle', opacity: 'toggle'}, "slow"); | |
− | + | // },function(){ | |
− | + | //$(this).next(".text").animate({height: 'toggle', opacity: 'toggle'}, "slow"); | |
− | + | //}); | |
− | + | $("div.text").hide();//默认隐藏div,或者在样式表中添加.text{display:none},推荐使用后者 | |
− | + | $(".box h5").click(function(){ | |
− | + | $(this).next(".text").slideToggle("slow"); | |
− | + | }) | |
− | + | }); | |
− | + | </script> | |
− | + | <style> | |
− | + | .firstHeading { | |
− | + | display:none; | |
− | + | } | |
− | + | figcaption { | |
− | + | color: #666666; | |
− | + | font-size: 0.7em; | |
− | + | font-style: italic; | |
− | + | font-family: 'Noto Sans', sans-serif; | |
− | + | margin-bottom: 15px; | |
− | + | } | |
+ | #content { | ||
+ | width:auto; | ||
+ | height:auto; | ||
+ | padding:0px 0px 0px 0px; | ||
+ | border:none; | ||
+ | } | ||
+ | * { | ||
+ | padding:0; | ||
+ | margin:0; | ||
+ | } | ||
+ | |||
+ | .banner { | ||
+ | height:55vh; | ||
+ | top:0; | ||
+ | background-color:black; | ||
+ | } | ||
+ | h1 { | ||
+ | color:white; | ||
+ | margin-top:15vh; | ||
+ | margin-left: 20vw; | ||
+ | position:absolute; | ||
+ | font-size: 4em; | ||
+ | } | ||
+ | |||
+ | .links { | ||
+ | margin-top: 5vh; | ||
+ | text-decoration:none; | ||
+ | color:blue; | ||
+ | margin-left:5vw; | ||
+ | } | ||
− | + | ||
− | + | .containerRight { | |
− | + | width:70vw; | |
+ | text-align: justify; | ||
+ | background-color:white; | ||
+ | margin-left: 25vw; | ||
+ | /*float: right;*/ | ||
+ | } | ||
+ | |||
+ | div h2 { | ||
+ | text-align: center; | ||
+ | margin-bottom: 8vh; | ||
+ | margin-top:5vh; | ||
+ | } | ||
+ | /* | ||
+ | .leftContainer { | ||
+ | width:22vw; | ||
+ | float:left; | ||
+ | height:100%; | ||
+ | text-align: center; | ||
+ | background-color:white; | ||
+ | }*/ | ||
− | + | table { | |
− | + | margin-top:15vh; | |
+ | border-radius: 10%; | ||
+ | margin-left:7.5vw; | ||
+ | float:left; | ||
+ | text-align:center; | ||
+ | } | ||
+ | |||
+ | td { | ||
+ | padding:0.8vw; | ||
+ | cursor:pointer; | ||
+ | margin-top: 4vh; | ||
+ | color:deepskyblue; | ||
+ | } | ||
+ | |||
+ | td:hover { | ||
+ | margin-top: 4vh; | ||
+ | background-color: deepskyblue; | ||
+ | color:white; | ||
+ | } | ||
+ | |||
+ | .fixed { | ||
+ | position: fixed; | ||
+ | top:5vh; | ||
− | + | } | |
− | + | ||
− | + | .final { | |
− | + | top: 230vh; | |
− | + | position:relative; | |
− | + | } | |
− | + | ||
− | + | .monster { | |
− | + | height:50vh; | |
− | + | width:15vw; | |
− | + | position:relative; | |
− | + | display:inline-block; | |
− | + | margin: 0 auto; | |
+ | } | ||
+ | |||
+ | .monsterContainer { | ||
+ | width:70vw; | ||
+ | height:50vh; | ||
+ | margin:10vh auto; | ||
+ | text-align: justify; | ||
+ | margin-bottom: 10vh; | ||
+ | |||
+ | } | ||
+ | |||
+ | .monsterContainer:after { | ||
+ | content: ""; | ||
+ | width: 100%; | ||
+ | display: inline-block; | ||
+ | } | ||
− | + | .monsterImg { | |
− | + | height:100%; | |
− | + | width:100%; | |
− | + | opacity:0.92; | |
− | + | box-shadow: 0 0 5px purple; | |
− | + | } | |
− | + | ||
+ | h3 { | ||
+ | color: white; | ||
+ | position:absolute; | ||
+ | bottom:5%; | ||
+ | left: 5%; | ||
+ | width:100%; | ||
+ | opacity:0.85; | ||
+ | } | ||
− | + | monsterSpan { | |
− | + | letter-spacing: -1px; | |
+ | background: rgb(30, 5, 90); | ||
+ | background: rgba(30, 5, 90, 0.7); | ||
+ | padding:5%; | ||
+ | } | ||
− | + | .dimmer { | |
− | + | opacity:1; | |
− | + | } | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | .dimmer2 { | |
− | + | text-decoration: underline; | |
− | + | opacity:1 | |
− | + | } | |
+ | h5{ | ||
+ | text-align:center; | ||
+ | font-size:18px; | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | .text{line-height:22px;padding:0 6px;} | ||
+ | .box h5{padding-top:0px;font-weight:bold;cursor: pointer;} | ||
+ | .box{position:relative;border:1px solid #e7e7e7;background-color:#C1EAFF;} | ||
+ | figcaption { | ||
+ | color: #666666; | ||
+ | font-size: 0.7em; | ||
+ | font-style: italic; | ||
+ | font-family: 'Noto Sans', sans-serif; | ||
+ | margin-bottom: 15px; | ||
+ | } | ||
+ | </style> | ||
+ | </head> | ||
+ | <body> | ||
+ | <script> | ||
− | + | $('.overview').click(function() { | |
− | + | $('html, body').animate({ scrollTop: $('.scrollOverview').offset().top}, 1000); | |
− | + | }); | |
− | + | ||
− | + | $('.sensor').click(function() { | |
− | + | $('html, body').animate({ scrollTop: $('.scrollSensor').offset().top}, 1000); | |
− | + | }); | |
− | + | ||
− | + | $('.survivability').click(function() { | |
− | + | $('html, body').animate({ scrollTop: $('.scrollSurvivability').offset().top}, 1000); | |
− | + | }); | |
− | + | ||
− | + | $('.conclusion').click(function() { | |
+ | $('html, body').animate({ scrollTop: $('.scrollConclusion').offset().top}, 1000); | ||
+ | }); | ||
+ | |||
+ | $('.results').click(function() { | ||
+ | $('html, body').animate({ scrollTop: $('.scrollResults').offset().top}, 1000); | ||
+ | }); | ||
+ | |||
+ | $('.top').click(function() { | ||
+ | $('html, body').animate({ scrollTop: $('.scrollTop').offset().top}, 1000); | ||
+ | }); | ||
+ | |||
+ | </script> | ||
+ | <script type="text/javascript"> | ||
+ | var x = $('.links').offset().top; | ||
+ | $(window).scroll(function() { | ||
+ | if ($(this).scrollTop() > x) { | ||
+ | $('table').addClass("fixed"); | ||
+ | } | ||
+ | |||
+ | |||
+ | else { | ||
+ | $('table').removeClass("fixed"); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | </script> | ||
+ | |||
+ | |||
+ | </body> | ||
</html> | </html> | ||
+ | |||
+ | {{Glasgowfooter}} |
Revision as of 10:55, 18 September 2015