|
|
Line 1: |
Line 1: |
| <html> | | <html> |
− |
| |
− |
| |
− | <script>
| |
− |
| |
− | // This is the jquery part of your template. Try not modify any of this code since it makes your menu work.
| |
− |
| |
− |
| |
− |
| |
− | $(document).ready(function() {
| |
− |
| |
− |
| |
− |
| |
− | hide_show_menu();
| |
− |
| |
− | $("#HQ_page").attr('id','');
| |
− |
| |
− | $( "#load_menu_here" ).load( "https://2017.igem.org/HQ:Menu #Menu" , function() {
| |
− |
| |
− | //executes menu functionality ( accordion and toggles) once the menu is loaded
| |
− | menu_functionality();
| |
− |
| |
− | // highlights on which page/hub you are currently in
| |
− | highlight_current_page();
| |
− |
| |
− | });
| |
− |
| |
− |
| |
− | $(".month_access").click(function(){
| |
− |
| |
− | $(this).next().next().fadeToggle(400);
| |
− | $(this).toggleClass("plus");
| |
− | });
| |
− |
| |
− | $(".expand_content.control_button").click(function(){
| |
− |
| |
− | $(this).next(".expand_content.more").fadeToggle(400);
| |
− | $(this).toggleClass("less");
| |
− | });
| |
− |
| |
− |
| |
− |
| |
− | function highlight_current_page () {
| |
− |
| |
− | wgPageName = wgPageName.replace(/\//g,"-"); // remove dashes from page name and turn them into "-"
| |
− |
| |
− |
| |
− | $('#' + wgPageName).addClass("current_page");
| |
− |
| |
− | switch ( (wgPageName.match( /-/g ) || []).length ) { // check how many "tiers" ( / ) the page name has in order to nest it
| |
− |
| |
− | case 0: // this is a main menu item
| |
− |
| |
− |
| |
− |
| |
− | $(".current_page > .submenu_access").addClass("less");
| |
− | $(".current_page > .submenu").fadeIn(400);
| |
− | break;
| |
− |
| |
− |
| |
− |
| |
− | case 1: // this is a link inside a submenu
| |
− |
| |
− | $('#' + wgPageName.substr(0, wgPageName.indexOf('-') )).addClass("current_page");
| |
− | $(".current_page > .submenu_access").addClass("less");
| |
− | $(".current_page > .submenu").fadeIn(400);
| |
− | break;
| |
− |
| |
− | case 2: // this is a link inside a submenu
| |
− |
| |
− | $('#' + wgPageName.substr(0, wgPageName.lastIndexOf('-') )).addClass("current_page");
| |
− | $('#' + wgPageName.substr(0, wgPageName.indexOf('-') )).addClass("current_page");
| |
− |
| |
− | $(".current_page > .submenu_access").addClass("less");
| |
− | $(".current_page > .submenu").fadeIn(400);
| |
− |
| |
− |
| |
− | $("#" + wgPageName.slice(wgPageName.indexOf("-")+1, wgPageName.lastIndexOf("-")) +"_submenu" ).fadeIn(400);
| |
− | $("#" + wgPageName.slice(wgPageName.indexOf("-")+1, wgPageName.lastIndexOf("-")) +"_submenu" ).prev().addClass("less");
| |
− |
| |
− | break;
| |
− |
| |
− | }
| |
− |
| |
− |
| |
− | }
| |
− |
| |
− |
| |
− | //menu functionality
| |
− | function menu_functionality() {
| |
− |
| |
− | $(".submenu_access").click(function(){
| |
− | $(this).next().fadeToggle(400);
| |
− | $(this).toggleClass("less");
| |
− | });
| |
− |
| |
− | $(".collapsable_menu_control").click(function() {
| |
− | $("#all_menu_items").fadeToggle(400);
| |
− | });
| |
− |
| |
− |
| |
− | $("#main_menu_control").click(function() {
| |
− |
| |
− | if($('.igem_menu_wrapper .submenu').is(':visible')) {
| |
− | $(".igem_menu_wrapper .submenu").hide();
| |
− | $(".submenu_access").removeClass("less");
| |
− | }
| |
− | else {
| |
− | $(".igem_menu_wrapper .submenu").show();
| |
− | $(".submenu_access").addClass("less");
| |
− | }
| |
− | });
| |
− | }
| |
− |
| |
− |
| |
− |
| |
− |
| |
− | function hide_show_menu() {
| |
− |
| |
− | if (document.getElementById('bars_item')) {
| |
− | $("#bars_item").click(function() {
| |
− | $("#sideMenu").hide();
| |
− | $(".igem_menu_wrapper").fadeToggle("100");
| |
− | $(".content_wrapper").toggleClass("full_screen");
| |
− | });
| |
− | }
| |
− | else {
| |
− | setTimeout(hide_show_menu, 15);
| |
− | }
| |
− | }
| |
− |
| |
− |
| |
− |
| |
− | //make boxes same height
| |
− |
| |
− | function make_boxes_same_height() {
| |
− | $(".same_height").css('height', Math.max(($(".same_height.A").height()),($(".same_height.B").height()), ($(".same_height.C").height()) ) );
| |
− | }
| |
− |
| |
− |
| |
− | //image slider
| |
− |
| |
− | $(function () {
| |
− |
| |
− | var change_img_time = 4500;
| |
− | var transition_speed = 450;
| |
− |
| |
− | var simple_slideshow = $(".image_slider"),
| |
− | listItems = simple_slideshow.children('li'),
| |
− | listLen = listItems.length,
| |
− | i = 0,
| |
− |
| |
− | change_images = function () {
| |
− |
| |
− | listItems.eq(i).fadeOut(transition_speed, function () {
| |
− |
| |
− | i += 1;
| |
− | if (i === listLen) {
| |
− | i = 0;
| |
− | }
| |
− |
| |
− | listItems.eq(i).fadeIn(transition_speed);
| |
− | });
| |
− | };
| |
− |
| |
− | listItems.not(':first').hide();
| |
− | setInterval( change_images, change_img_time);
| |
− |
| |
− | });
| |
− |
| |
− | make_boxes_same_height();
| |
− |
| |
− |
| |
− |
| |
− | });
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− | </script>
| |
− |
| |
− |
| |
| <style> | | <style> |
− |
| |
− |
| |
− |
| |
| /********************************* DEFAULT WIKI SETTINGS ********************************/ | | /********************************* DEFAULT WIKI SETTINGS ********************************/ |
| #home_logo, #sideMenu { display:none; } | | #home_logo, #sideMenu { display:none; } |