Difference between revisions of "Team:METU Turkey team"
(Replaced content with "<html> </html> <html> <head> <script type="text/javascript"> // The script below will remove all wikistylesheets, so you now have unlimited freedom for inline CSS. for...") |
|||
Line 20: | Line 20: | ||
<body> | <body> | ||
<div class="site-wrapper"> | <div class="site-wrapper"> | ||
+ | |||
+ | |||
+ | |||
</div> | </div> | ||
+ | <script> | ||
+ | $(document).ready(function() { | ||
+ | document.title = 'iGEM Berlin 2014 | Home | @igem.org'; | ||
+ | }); | ||
+ | // NAVBAR STYLE | ||
+ | |||
+ | $(document).ready(function(){ | ||
+ | // this will get the full URL at the address bar | ||
+ | var url = window.location.href; | ||
+ | // passes on every "a" tag | ||
+ | $(".main-menue-ul a").each(function() { | ||
+ | // checks if its the same on the address bar | ||
+ | if(url == (this.href)) { | ||
+ | $(this).children("li").addClass("active"); | ||
+ | $(this).removeClass("main-menue-links"); | ||
+ | |||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // my scroll to | ||
+ | $("#main-button").click(function() { | ||
+ | $('html, body').animate({ | ||
+ | scrollTop: $("#main-featurette-row").offset().top - 57 | ||
+ | }, 720); | ||
+ | }); | ||
+ | |||
+ | // my scroll to | ||
+ | $("#ecoli-button").click(function() { | ||
+ | $('html, body').animate({ | ||
+ | scrollTop: $("#first-featurette-row").offset().top - 57 | ||
+ | }, 800); | ||
+ | }); | ||
+ | |||
+ | // my scroll to | ||
+ | $("#project-button").click(function() { | ||
+ | $('html, body').animate({ | ||
+ | scrollTop: $("#team-featurette-row").offset().top - 57 | ||
+ | }, 800); | ||
+ | }); | ||
+ | |||
+ | // my scroll to | ||
+ | $("#team-button").click(function() { | ||
+ | $('html, body').animate({ | ||
+ | scrollTop: $("#blog-featurette-row").offset().top - 57 | ||
+ | }, 800); | ||
+ | }); | ||
+ | |||
+ | |||
+ | $(document).ready(function(){ | ||
+ | // cache the window object | ||
+ | $window = $(window); | ||
+ | |||
+ | $('section[data-type="background"]').each(function(){ | ||
+ | // declare the variable to affect the defined data-type | ||
+ | var $scroll = $(this); | ||
+ | |||
+ | $(window).scroll(function() { | ||
+ | // HTML5 proves useful for helping with creating JS functions! | ||
+ | // also, negative value because we're scrolling upwards | ||
+ | var yPos = -($window.scrollTop() / $scroll.data('speed')); | ||
+ | |||
+ | // background position | ||
+ | var coords = '80% '+ yPos + 'px'; | ||
+ | |||
+ | // move the background | ||
+ | $scroll.css({ backgroundPosition: coords }); | ||
+ | }); // end window scroll | ||
+ | }); // end section function | ||
+ | |||
+ | $("#section-B").hide(); | ||
+ | $("#section-C").hide(); | ||
+ | $("#C-up").hide(); | ||
+ | $("#B-up").hide(); | ||
+ | |||
+ | $("#show-B").click(function(){ | ||
+ | $("#section-B").slideToggle(); | ||
+ | $("#B-up").toggle(); | ||
+ | $("#B-down").toggle(); | ||
+ | }); | ||
+ | |||
+ | $("#show-C").click(function(){ | ||
+ | $("#section-C").slideToggle(); | ||
+ | $("#C-up").toggle(); | ||
+ | $("#C-down").toggle(); | ||
+ | }); | ||
+ | |||
+ | }); // close out script | ||
+ | |||
+ | |||
+ | //NAVBAR STYLE | ||
+ | $(".main-menue").css("background-color", "transparent"); | ||
+ | |||
+ | $(window).scroll(function() { | ||
+ | |||
+ | if ($(this).scrollTop() >= 240) { | ||
+ | $(".main-menue").css("background-color","rgb(255, 255, 255)"); | ||
+ | } | ||
+ | |||
+ | if ($(this).scrollTop() < 240) { // this refers to window | ||
+ | $(".main-menue").css("background-color","transparent"); | ||
+ | } | ||
+ | |||
+ | }); | ||
+ | |||
+ | var windowSize = $(window).height(); | ||
+ | $(".site-wrapper").css( "height" , windowSize ); | ||
+ | |||
+ | |||
+ | // Change iGEM.ORG Wiki Style | ||
+ | $("#top-section").addClass("navbar-fixed-top hidden-xs hidden-sm hidden-md"); | ||
+ | $("#top-section").css("background-color","white"); | ||
+ | $(".left-menu").css("float","left"); | ||
+ | $(".right-menu").css("float","right"); | ||
+ | |||
+ | $( ".left-menu ul li" ).each(function() { | ||
+ | $( this ).css( "margin-right","10px" ); | ||
+ | }); | ||
+ | |||
+ | $( ".right-menu ul li" ).each(function() { | ||
+ | $( this ).css( "margin-left","10px" ); | ||
+ | }); | ||
+ | |||
+ | $( ".right-menu ul li:last-child" ).css( "margin-right","10px" ); | ||
+ | |||
+ | $( "html" ).css( "margin-top","-10px" ); | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | </script> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 16:48, 30 July 2015