Template:Team:KIT-Kyoto/mobile
From 2014.igem.org
(Difference between revisions)
Line 2: | Line 2: | ||
<head> | <head> | ||
<meta name="viewport" content="width=device-width; initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" /> | <meta name="viewport" content="width=device-width; initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" /> | ||
+ | <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | ||
+ | <script type="text/javascript"> | ||
+ | $(function(){ | ||
+ | var ua = navigator.userAgent; | ||
+ | if(ua.indexOf('iPhone') > 0 || ua.indexOf('Android') > 0 || ua.indexOf('BlackBerry') > 0 || ua.indexOf('Windows Phone') > 0){ | ||
+ | $(".accordion").addClass('m-active'); | ||
+ | } | ||
+ | $(".m-active h2 a").click(function(){ | ||
+ | var num = $(".m-active h2 a").index(this); | ||
+ | if($(".ac").eq(num).is(':hidden')){ | ||
+ | $(".ac").eq(num).slideDown(); | ||
+ | }else { | ||
+ | $(".ac").eq(num).slideUp(); | ||
+ | } | ||
+ | }); | ||
</script> | </script> | ||
<style type="text/css"> | <style type="text/css"> | ||
Line 81: | Line 96: | ||
z-index:10; | z-index:10; | ||
} | } | ||
- | .accordion | + | .accordion h2 a{ |
position: relative; | position: relative; | ||
display: block; | display: block; | ||
- | + | cursor: pointer; | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
div.ac { | div.ac { | ||
- | + | display:none; | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
} | } | ||
</style> | </style> | ||
</head> | </head> |
Revision as of 19:51, 21 September 2014