Team:ZJU-China/JS/wiki.js
From 2014.igem.org
(Difference between revisions)
(Created page with "$(".left-menu li:last-child").css('color', 'transparent');") |
|||
(8 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
+ | /* hide the white moji "team" */ | ||
$(".left-menu li:last-child").css('color', 'transparent'); | $(".left-menu li:last-child").css('color', 'transparent'); | ||
+ | |||
+ | $(document).ready(function () { | ||
+ | $("li#igem_edit").click(function () { | ||
+ | if ($("li#igem_edit").attr('class') === 'edit_on') { | ||
+ | $("#top-section").css('background-color', 'transparent'); | ||
+ | $("#menubar a:link, #menubar a:active, #menubar a:visited, #menubar a:hover, #menubar:hover").removeAttr("style"); | ||
+ | } else { | ||
+ | $("#top-section").css('background-color', '#5c5c5c'); | ||
+ | $("#menubar a:link, #menubar a:active, #menubar a:visited").css('color', '#fff'); | ||
+ | } | ||
+ | $("li#igem_edit").toggleClass("edit_on"); | ||
+ | }); | ||
+ | |||
+ | /*display of menu*/ | ||
+ | $("ul.zju_menu_list > li").hover( | ||
+ | function () { | ||
+ | $(this).children("ul.zju_sub_menu").show(300); | ||
+ | }, | ||
+ | function () { | ||
+ | $(this).children("ul.zju_sub_menu").hide(200); | ||
+ | } | ||
+ | ); | ||
+ | $("ul.zju_sub_menu > li").hover( | ||
+ | function () { | ||
+ | $(this).children("ul.zju_son_menu").show(300); | ||
+ | }, | ||
+ | function () { | ||
+ | $(this).children("ul.zju_son_menu").hide(100); | ||
+ | } | ||
+ | ); | ||
+ | |||
+ | /* Nagavitor Script */ | ||
+ | |||
+ | $("ul#side_nav li").click(function () { | ||
+ | $.scrollTo($(this).attr("href"), 800); | ||
+ | }); | ||
+ | $("span.guide img").click(function () { | ||
+ | $.scrollTo($(this).attr("href"), 600); | ||
+ | }); | ||
+ | $("img#home_bar").click(function () { | ||
+ | $.scrollTo($(this).attr("href"), 600); | ||
+ | }); | ||
+ | |||
+ | /* Home Page */ | ||
+ | $("div.sld").css('font-size', $("div.sld").width()/144); | ||
+ | $("div.sld div.ft").css('font-size', $("div.sld").width()/1920*$('div.sld div.ft').css('font-size')); | ||
+ | $(window).resize(function(){ | ||
+ | $("div.sld").css('font-size', $("div.sld").width()/144); | ||
+ | $("div.sld div.ft").css('font-size', $("div.sld").width()/1920*$('div.sld div.ft').css('font-size')); | ||
+ | }); | ||
+ | |||
+ | /*animation playing*/ | ||
+ | |||
+ | $("div.ani").click(function(){ | ||
+ | $(this).children("img").toggle(); | ||
+ | }); | ||
+ | /* move the footer to the right place */ | ||
+ | $("#footer-box").prepend($("div.zju_footer")); | ||
+ | /* hide and show media wiki */ | ||
+ | $("span#mediawikilogo").click(function () { | ||
+ | $("div#footer").toggle("normal"); | ||
+ | }); | ||
+ | }); |
Latest revision as of 00:16, 18 October 2014
/* hide the white moji "team" */ $(".left-menu li:last-child").css('color', 'transparent');
$(document).ready(function () {
$("li#igem_edit").click(function () { if ($("li#igem_edit").attr('class') === 'edit_on') { $("#top-section").css('background-color', 'transparent'); $("#menubar a:link, #menubar a:active, #menubar a:visited, #menubar a:hover, #menubar:hover").removeAttr("style"); } else { $("#top-section").css('background-color', '#5c5c5c'); $("#menubar a:link, #menubar a:active, #menubar a:visited").css('color', '#fff'); } $("li#igem_edit").toggleClass("edit_on"); });
/*display of menu*/ $("ul.zju_menu_list > li").hover( function () { $(this).children("ul.zju_sub_menu").show(300); }, function () { $(this).children("ul.zju_sub_menu").hide(200); } ); $("ul.zju_sub_menu > li").hover( function () { $(this).children("ul.zju_son_menu").show(300); }, function () { $(this).children("ul.zju_son_menu").hide(100); } ); /* Nagavitor Script */ $("ul#side_nav li").click(function () { $.scrollTo($(this).attr("href"), 800); }); $("span.guide img").click(function () { $.scrollTo($(this).attr("href"), 600); }); $("img#home_bar").click(function () { $.scrollTo($(this).attr("href"), 600); });
/* Home Page */ $("div.sld").css('font-size', $("div.sld").width()/144); $("div.sld div.ft").css('font-size', $("div.sld").width()/1920*$('div.sld div.ft').css('font-size')); $(window).resize(function(){ $("div.sld").css('font-size', $("div.sld").width()/144); $("div.sld div.ft").css('font-size', $("div.sld").width()/1920*$('div.sld div.ft').css('font-size')); });
/*animation playing*/
$("div.ani").click(function(){ $(this).children("img").toggle(); }); /* move the footer to the right place */ $("#footer-box").prepend($("div.zju_footer")); /* hide and show media wiki */ $("span#mediawikilogo").click(function () { $("div#footer").toggle("normal"); });
});