Team:UNITN-Trento/JS/Main

From 2013.igem.org

(Difference between revisions)
 
(9 intermediate revisions not shown)
Line 2: Line 2:
$(document).ready(function() {
$(document).ready(function() {
/*Move the tn-main-wrap as child of <body>*/
/*Move the tn-main-wrap as child of <body>*/
-
$("#tn-main-wrap").prependTo($("body"));
+
$("#tn-main-wrap-wrap").prependTo($("body"));
/*Move the menubars in the tn-main-wrap*/
/*Move the menubars in the tn-main-wrap*/
$("#menubar.left-menu").appendTo($("#tn-main-wrap"));
$("#menubar.left-menu").appendTo($("#tn-main-wrap"));
Line 16: Line 16:
$(".tn-spoiler-active").children("div").slideToggle();
$(".tn-spoiler-active").children("div").slideToggle();
});
});
 +
 +
/*Tour*/
 +
if ( undefined != document.location.hash ) {
 +
hash = document.location.hash;
 +
} else {
 +
hash = "";
 +
}
 +
 +
if ( 0 < hash.indexOf("tour") ) {
 +
$(".sheet-2").css('display' , 'none');
 +
}
/*Add favicon*/
/*Add favicon*/
-
$("link[href='/favicon.ico']").attr("type","image/png");
+
$("link[rel='shortcut icon']").remove();
-
$("link[href='/favicon.ico']").attr("href","https://static.igem.org/mediawiki/2013/8/8f/Tn-2013-favicon.png");
+
$("head").append("<link rel='shortcut icon' type='image/png' href='https://static.igem.org/mediawiki/2013/8/8f/Tn-2013-favicon.png'>");
});
});

Latest revision as of 12:06, 30 September 2013

/*Acts once the document is loaded*/ $(document).ready(function() { /*Move the tn-main-wrap as child of <body>*/ $("#tn-main-wrap-wrap").prependTo($("body")); /*Move the menubars in the tn-main-wrap*/ $("#menubar.left-menu").appendTo($("#tn-main-wrap")); $("#menubar.right-menu").appendTo($("#tn-main-wrap"));

/*Spoiler JS*/ $(".tn-spoiler div").slideUp(); $(".tn-spoiler a").click(function(e) { e.preventDefault(); $(".tn-spoiler-active").removeClass("tn-spoiler-active"); $(this).parent().addClass("tn-spoiler-active"); $(".tn-spoiler").not(".tn-spoiler-active").children("div").slideUp(); $(".tn-spoiler-active").children("div").slideToggle(); });

/*Tour*/ if ( undefined != document.location.hash ) { hash = document.location.hash; } else { hash = ""; }

if ( 0 < hash.indexOf("tour") ) { $(".sheet-2").css('display' , 'none'); }

/*Add favicon*/ $("link[rel='shortcut icon']").remove(); $("head").append("<link rel='shortcut icon' type='image/png' href='https://static.igem.org/mediawiki/2013/8/8f/Tn-2013-favicon.png'>"); });