Difference between revisions of "Team:Cambridge-JIC/Templates/Menu"
m (bug tracking...) |
|||
Line 15: | Line 15: | ||
<link href="//2015.igem.org/wiki/images/3/3a/CamJIC-Favicon.png" rel="icon"> | <link href="//2015.igem.org/wiki/images/3/3a/CamJIC-Favicon.png" rel="icon"> | ||
<script src="//2015.igem.org/Team:Cambridge-JIC/Assets/Bootstrap.js?action=raw&ctype=text/javascript"></script> | <script src="//2015.igem.org/Team:Cambridge-JIC/Assets/Bootstrap.js?action=raw&ctype=text/javascript"></script> | ||
+ | <script> | ||
+ | function hndl(me) { | ||
+ | if($(me).parent().children("div").is(':visible')) { | ||
+ | $(".navsub_m").hide() | ||
+ | } else { | ||
+ | $(".navsub_m").hide() | ||
+ | $(me).parent().children("div").show() | ||
+ | } | ||
+ | } | ||
+ | |||
+ | $(window).ready(function(){ | ||
+ | |||
+ | $(window).on("resize", function () { | ||
+ | if($(".navbar-toggle").is(":visible")) { | ||
+ | $(".navsub").each(function() { | ||
+ | $(this).removeClass("navsub"); | ||
+ | $(this).addClass("navsub_m"); | ||
+ | $(this).hide(); | ||
+ | $(this).data("link", $(this).parent().children("a").attr("href")); | ||
+ | $(this).parent().children("a").attr("href", "#"); | ||
+ | $(this).parent().children("a").attr("onclick", "hndl(this)"); | ||
+ | }) | ||
+ | $(".slide").each(function(){ | ||
+ | if($(this).data("mobile") == null) { | ||
+ | $(this).data("mobile", 1) | ||
+ | $(this).data("width", $(this).width()); | ||
+ | $(this).width("auto") | ||
+ | |||
+ | $(this).data("minheight", $(this).css("min-height")); | ||
+ | $(this).css("min-height", "0px") | ||
+ | |||
+ | $(this).children("div").data("fsz", $(this).children("div").css("font-size")); | ||
+ | $(this).children("div").css("font-size", "12pt") | ||
+ | |||
+ | $(this).children("div").data("ml", $(this).children("div").css("margin-left")); | ||
+ | $(this).children("div").css("margin-left", "30px") | ||
+ | |||
+ | $(".team .face .profile p").data("fsz", $(".team .face .profile p").css("font-size")); | ||
+ | $(".team .face .profile p").css("font-size", "70%") | ||
+ | |||
+ | $(this).data("img", $(this).css("background-image")); | ||
+ | |||
+ | mobimg = $(this).data("mobimg") | ||
+ | $(this).css("background-image", (mobimg == null? "none":mobimg)) | ||
+ | } | ||
+ | }); | ||
+ | } else { | ||
+ | $(".navsub_m").each(function(){ | ||
+ | $(this).removeClass("navsub_m"); | ||
+ | $(this).show() | ||
+ | $(this).addClass("navsub"); | ||
+ | $(this).parent().children("a").attr("href", $(this).data("link")); | ||
+ | $(this).parent().children("a").attr("onclick", ""); | ||
+ | }) | ||
+ | $(".slide").each(function(){ | ||
+ | if($(this).data("mobile") == 1) { | ||
+ | $(this).data("mobile", null) | ||
+ | $(this).width($(this).data("width")+"px") | ||
+ | $(this).css("background-image", $(this).data("img")) | ||
+ | $(this).css("min-height", $(this).data("minheight")) | ||
+ | $(this).children("div").css("font-size", $(this).children("div").data("fsz")) | ||
+ | $(this).children("div").css("margin-left", $(this).children("div").data("ml")) | ||
+ | $(".team .face .profile p").css("font-size", $(".team .face .profile p").data("fsz")) | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | $(".navbar-collapse").css("max-height", $(window).height()+"px") | ||
+ | }).resize(); | ||
+ | |||
+ | $(".face").on("touch", function(){ | ||
+ | |||
+ | $(".profile").css("opacity", 1); | ||
+ | $(".blur").css("opacity", 1); | ||
+ | |||
+ | //$(this).children(".profile").css("opacity", 1) | ||
+ | |||
+ | }) | ||
+ | |||
+ | }); | ||
+ | </script> | ||
+ | |||
+ | <style> | ||
+ | .navbar-collapse { | ||
+ | max-height: 100%; | ||
+ | } | ||
+ | |||
+ | .navsub_m { | ||
+ | background: #333; | ||
+ | text-align: center; | ||
+ | } | ||
+ | |||
+ | .navsub_m ul { | ||
+ | margin:0; | ||
+ | padding:0; | ||
+ | width: 100%; | ||
+ | } | ||
+ | |||
+ | .navsub_m ul li { | ||
+ | width: 100%; | ||
+ | margin:0; | ||
+ | display: inline-block; | ||
+ | } | ||
+ | |||
+ | .navsub_m ul li a { | ||
+ | padding: 10px 0px; | ||
+ | width: 100%; | ||
+ | text-decoration: none; | ||
+ | display:block; | ||
+ | } | ||
+ | |||
+ | .col-md-3 { | ||
+ | text-align: center; | ||
+ | margin-bottom: 40px; | ||
+ | } | ||
+ | |||
+ | </style> | ||
<div class="cam-container"> | <div class="cam-container"> |
Revision as of 10:57, 28 July 2015