Difference between revisions of "Team:Cambridge-JIC/Templates/Menu"
m |
|||
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("click", facepalm) | ||
+ | $(".profile").on("hover", facepalm) | ||
+ | |||
+ | }); | ||
+ | |||
+ | function facepalm(){ | ||
+ | alert('test') | ||
+ | $(".blur").removeClass("facehovered"); | ||
+ | $(".profile").removeClass("profilehovered"); | ||
+ | $(".profile").css("opacity", 0); | ||
+ | |||
+ | $(this).children(".blur").addClass("facehovered"); | ||
+ | $(this).children(".profile").addClass("profilehovered"); | ||
+ | $(this).children(".profile").css("opacity", 1); | ||
+ | } | ||
+ | </script> | ||
<style> | <style> |
Revision as of 11:12, 28 July 2015