Difference between revisions of "Team:Cambridge-JIC/Templates/Menu"
m |
(More mobile support) |
||
Line 14: | Line 14: | ||
<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> | <script> | ||
function hndl(me) { | function hndl(me) { | ||
Line 33: | Line 32: | ||
$(this).removeClass("navsub"); | $(this).removeClass("navsub"); | ||
$(this).addClass("navsub_m"); | $(this).addClass("navsub_m"); | ||
− | $(this).hide() | + | $(this).hide(); |
$(this).data("link", $(this).parent().children("a").attr("href")); | $(this).data("link", $(this).parent().children("a").attr("href")); | ||
$(this).parent().children("a").attr("href", "#"); | $(this).parent().children("a").attr("href", "#"); | ||
$(this).parent().children("a").attr("onclick", "hndl(this)"); | $(this).parent().children("a").attr("onclick", "hndl(this)"); | ||
}) | }) | ||
+ | $(".slide").each(function(){ | ||
+ | $(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") | ||
+ | |||
+ | $(this).data("img", $(this).css("background-image")); | ||
+ | |||
+ | mobimg = $(this).data("mobimg") | ||
+ | $(this).css("background-image", (mobimg == null? "none":mobimg)) | ||
+ | }); | ||
} else { | } else { | ||
$(".navsub_m").each(function(){ | $(".navsub_m").each(function(){ | ||
Line 46: | Line 63: | ||
$(this).parent().children("a").attr("onclick", ""); | $(this).parent().children("a").attr("onclick", ""); | ||
}) | }) | ||
+ | $(".slide").each(function(){ | ||
+ | $(this).width($(this).data("width")) | ||
+ | $(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")) | ||
+ | }); | ||
} | } | ||
}).resize(); | }).resize(); |
Revision as of 01:21, 28 July 2015