(fixed moving small buttons complete) |
|||
(24 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
<script> | <script> | ||
− | |||
− | |||
$(document).ready(function() { | $(document).ready(function() { | ||
Line 69: | Line 67: | ||
$(".sub-navbar").attr("style", "top: " + ($logoHeight + 16) + "px;"); | $(".sub-navbar").attr("style", "top: " + ($logoHeight + 16) + "px;"); | ||
if ($imgSrc == "https://static.igem.org/mediawiki/2017/4/4a/T--Bielefeld-CeBiTec--expand_monochrome_white_2.svg") { | if ($imgSrc == "https://static.igem.org/mediawiki/2017/4/4a/T--Bielefeld-CeBiTec--expand_monochrome_white_2.svg") { | ||
− | $(".container").attr("style", " | + | //$(".container.start-page").attr("style", "padding-top: " + ($logoHeight + 10) + "px;"); |
} | } | ||
if ($scrollHeight >= 80) { | if ($scrollHeight >= 80) { | ||
Line 98: | Line 96: | ||
$(window).on('resize', function(){ | $(window).on('resize', function(){ | ||
resizeNavbar(); | resizeNavbar(); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}); | }); | ||
$(window).on('load', function() { | $(window).on('load', function() { | ||
$story = ["https://2017.igem.org/Team:Bielefeld-CeBiTec", | $story = ["https://2017.igem.org/Team:Bielefeld-CeBiTec", | ||
+ | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Project/Overview", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Project/unnatural_base_pair", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Project/unnatural_base_pair", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Project/unnatural_base_pair/unnatural_base_pairs", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Project/unnatural_base_pair/unnatural_base_pairs", | ||
Line 126: | Line 115: | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Project/toolbox/photolysis", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Project/toolbox/photolysis", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Project/toolbox/fusing", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Project/toolbox/fusing", | ||
+ | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Demonstrate", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/unnatural_base_pair", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/unnatural_base_pair", | ||
− | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/unnatural_base_pair/ | + | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/unnatural_base_pair/uptake", |
+ | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/unnatural_base_pair/biosynthesis", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/unnatural_base_pair/preservation_system", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/unnatural_base_pair/preservation_system", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/unnatural_base_pair/development_of_new_methods", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/unnatural_base_pair/development_of_new_methods", | ||
Line 139: | Line 130: | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/toolbox/photolysis", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/toolbox/photolysis", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/toolbox/fusing", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Results/toolbox/fusing", | ||
− | |||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Parts", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Parts", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Basic_Part", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Basic_Part", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Composite_Part", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Composite_Part", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Part_Collection", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Part_Collection", | ||
+ | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Improve", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Achievements", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Achievements", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Hardware", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Hardware", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Software", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Software", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Model", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Model", | ||
+ | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Measurement", | ||
+ | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Applied_Design", | ||
+ | "https://2017.igem.org/Team:Bielefeld-CeBiTec/InterLab", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/HP", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/HP", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/HP/Silver", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/HP/Silver", | ||
Line 163: | Line 157: | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Notebook/Oligonucleotides", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Notebook/Oligonucleotides", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Notebook/Labjournal", | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Notebook/Labjournal", | ||
+ | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Notebook/LabnotesGenerator", | ||
"https://2017.igem.org/Team:Bielefeld-CeBiTec/Safety"]; | "https://2017.igem.org/Team:Bielefeld-CeBiTec/Safety"]; | ||
$url = window.location.href; | $url = window.location.href; | ||
+ | if ($url.indexOf("#") > -1) { | ||
+ | $url = $url.substring(0, $url.indexOf("#")); | ||
+ | } | ||
$index = 0; | $index = 0; | ||
for (i = 0; i < $story.length; i++) { | for (i = 0; i < $story.length; i++) { | ||
Line 175: | Line 173: | ||
if ($index == 0) { | if ($index == 0) { | ||
$("#page-switch-prev-li").hide(); | $("#page-switch-prev-li").hide(); | ||
+ | $("#footer-left").html("<p></p>"); | ||
} else { | } else { | ||
$("#page-switch-prev").attr("href", $story[$index - 1]); | $("#page-switch-prev").attr("href", $story[$index - 1]); | ||
Line 184: | Line 183: | ||
} | } | ||
+ | hideNavbars(); | ||
+ | if ($(document).scrollTop() == 0) { | ||
+ | $("#logo-img").attr("src", "https://static.igem.org/mediawiki/2017/4/4a/T--Bielefeld-CeBiTec--expand_monochrome_white_2.svg"); | ||
+ | } else { | ||
+ | $("#logo-img").attr("src", "https://static.igem.org/mediawiki/2017/6/6e/T--Bielefeld-CeBiTec--expand_monochrome_white_2_collapse.svg"); | ||
+ | } | ||
+ | resizeNavbar(); | ||
+ | $(".cover").hide(); | ||
+ | $("#cover-set").hide(); | ||
+ | $("#cover").css({"background":"rgba(0, 0, 0, 0.5)"}); | ||
+ | $("#cover-box").css({"background":"rgba(255, 255, 255, 1)"}); | ||
+ | $("#cover-box-img").css({"background":"rgba(255, 255, 255, 1)"}); | ||
+ | $("#cover-box-text").css({"background":"rgba(255, 255, 255, 1)"}); | ||
+ | |||
+ | if ($(window).scrollTop() == 0) { | ||
+ | $("#page-arrow-top").css("display", "none"); | ||
+ | } else { | ||
+ | $("#page-arrow-top").css("display", "block"); | ||
+ | } | ||
+ | |||
+ | if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)) { | ||
+ | $(".test").html("mobile"); | ||
+ | } else { | ||
+ | $(".test").html("not mobile"); | ||
+ | } | ||
}); | }); | ||
Line 408: | Line 432: | ||
//get center x position of item and place subitems centered to this | //get center x position of item and place subitems centered to this | ||
− | if ( | + | if ($(this).html().indexOf("▼") > -1) { |
$middle = $(this).position().left + ($(this).width() * 0.5); | $middle = $(this).position().left + ($(this).width() * 0.5); | ||
$totalWidth = 0; | $totalWidth = 0; | ||
− | |||
$('.sub-navbar-item').each(function(i, obj) { | $('.sub-navbar-item').each(function(i, obj) { | ||
− | if ( | + | if ($(obj).is(":visible")) { |
− | + | if ($($clickItem).hasClass("sub-navbar-item")) { | |
− | + | ||
− | + | ||
− | + | ||
if ($(obj).hasClass("small")) { | if ($(obj).hasClass("small")) { | ||
if ($totalWidth == 0) { | if ($totalWidth == 0) { | ||
Line 425: | Line 445: | ||
$totalWidth = $totalWidth + $(obj).width(); | $totalWidth = $totalWidth + $(obj).width(); | ||
} | } | ||
− | + | } else { | |
− | + | ||
− | + | ||
if ($totalWidth == 0) { | if ($totalWidth == 0) { | ||
$leftItem = obj; | $leftItem = obj; | ||
Line 435: | Line 453: | ||
} | } | ||
}); | }); | ||
− | + | $newPos = ($middle - ($totalWidth * 0.5)); | |
− | + | if ($newPos < 0) { | |
− | + | $newPos = 0; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
+ | if ($newPos + $totalWidth > $("body").width()) { | ||
+ | $newPos = $("body").width() - $totalWidth; | ||
+ | } | ||
+ | $newPos = $newPos + "px"; | ||
+ | |||
+ | $($leftItem).css({'margin-left':$newPos}); | ||
} | } | ||
}); | }); | ||
Line 472: | Line 488: | ||
+ | /*$(document).ready(function() { | ||
+ | $(".figure").mousedown(function() { | ||
+ | $clickItem = $(this); | ||
+ | $img = $clickItem.children("img"); | ||
+ | $p = $clickItem.children("p"); | ||
+ | $("#cover-img").attr("src", $img.attr("src")); | ||
+ | $("#cover-set").attr("src", $img.attr("src")); | ||
+ | $size = $("#cover-set").height(); | ||
+ | if ($size > $("#cover-box").height() * 0.85) { | ||
+ | $newSize = ($("#cover-box").height() * 0.85); | ||
+ | $("#cover-img").height($newSize + "px"); | ||
+ | } | ||
+ | $size = $("#cover-set").width(); | ||
+ | /*if ($size > $("#cover-box").width()) { | ||
+ | $newSize = ($("#cover-box").width()); | ||
+ | $("#cover-img").width($newSize + "px"); | ||
+ | }*/ | ||
+ | /*$("#cover-p").html($p.html()); | ||
+ | $(".cover").fadeIn(200); | ||
+ | |||
+ | |||
+ | $topPos = $("#cover-box").position().top; | ||
+ | $(".test").html($("#cover-box").height()); | ||
+ | $topPos = $("#cover-box").height() * 0.5 + 30 + "px"; | ||
+ | $("#cover-box").css("top", $topPos); | ||
+ | }); | ||
+ | });*/ | ||
+ | $(document).ready(function() { | ||
+ | $(".cover").mousedown(function() { | ||
+ | $(".cover").fadeOut(200); | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | $(document).ready(function() { | ||
+ | $(".page-switch.prev").mouseover(function() { | ||
+ | $hoverItem = $(this); | ||
+ | $hoverItem.attr("src", "https://static.igem.org/mediawiki/2017/c/cd/T--Bielefeld-CeBiTec--page-arrow-previous-white.svg"); | ||
+ | }); | ||
+ | $(".page-switch.next").mouseover(function() { | ||
+ | $hoverItem = $(this); | ||
+ | $hoverItem.attr("src", "https://static.igem.org/mediawiki/2017/4/45/T--Bielefeld-CeBiTec--page-arrow-next-white.svg"); | ||
+ | }); | ||
+ | $("#page-arrow-top").mouseover(function() { | ||
+ | $hoverItem = $(this); | ||
+ | $hoverItem.attr("src", "https://static.igem.org/mediawiki/2017/d/dc/T--Bielefeld-CeBiTec--page-arrow-top-white.svg"); | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | $(document).ready(function() { | ||
+ | $(".page-switch.prev").mouseout(function() { | ||
+ | $hoverItem = $(this); | ||
+ | $hoverItem.attr("src", "https://static.igem.org/mediawiki/2017/4/44/T--Bielefeld-CeBiTec--page-arrow-previous.svg"); | ||
+ | }); | ||
+ | $(".page-switch.next").mouseout(function() { | ||
+ | $hoverItem = $(this); | ||
+ | $hoverItem.attr("src", "https://static.igem.org/mediawiki/2017/c/c8/T--Bielefeld-CeBiTec--page-arrow-next.svg"); | ||
+ | }); | ||
+ | $("#page-arrow-top").mouseout(function() { | ||
+ | $hoverItem = $(this); | ||
+ | $hoverItem.attr("src", "https://static.igem.org/mediawiki/2017/b/b2/T--Bielefeld-CeBiTec--page-arrow-top.svg"); | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | function topFunction() { | ||
+ | document.body.scrollTop = 0; // For Chrome, Safari and Opera | ||
+ | document.documentElement.scrollTop = 0; // For IE and Firefox | ||
+ | } | ||
+ | |||
+ | $(window).scroll(function(){ | ||
+ | if ($(window).scrollTop() == 0) { | ||
+ | $("#page-arrow-top").css("display", "none"); | ||
+ | } else { | ||
+ | $("#page-arrow-top").css("display", "block"); | ||
+ | } | ||
+ | if ($(window).scrollTop() > 50) { | ||
+ | $("#page-arrow-top").css("opacity", 1); | ||
+ | } else { | ||
+ | $("#page-arrow-top").css("opacity", ($(window).scrollTop() / 50)); | ||
+ | } | ||
+ | if ($(window).scrollTop() > $(document).height() - $(window).height() - 80) { | ||
+ | $newPos = 20 + ($(window).scrollTop() - ($(document).height() - $(window).height() - 80)); | ||
+ | $("#page-arrow-top").css("bottom", $newPos + "px"); | ||
+ | } else { | ||
+ | $("#page-arrow-top").css("bottom", "20px"); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | $(document).ready(function() { | ||
+ | $(".hidden-expand").mousedown(function() { | ||
+ | $clickItem = $(this); | ||
+ | $clickItem.parent().next(".hidden-block").slideToggle(500, function() {}); | ||
+ | }); | ||
+ | }); | ||
</script> | </script> | ||
</html> | </html> |
Latest revision as of 03:57, 2 November 2017