Template:Team:KIT-Kyoto/mobile

From 2014.igem.org

(Difference between revisions)
(Undo revision 151197 by Pudding (talk))
Line 14: Line 14:
                               <ul class="m_menu_right">
                               <ul class="m_menu_right">
<li><a href="/Team:KIT-Kyoto/Test/Parts">Parts</a></li>
<li><a href="/Team:KIT-Kyoto/Test/Parts">Parts</a></li>
-
<li><a href="/Team:KIT-Kyoto/HumanPractice">HumanPractice</a></li>
+
<li><a href="/Team:KIT-Kyoto/HumanPractice">HumanPractices</a></li>
<li><a href="/Team:KIT-Kyoto/Test/Safety">Safety</a></li>
<li><a href="/Team:KIT-Kyoto/Test/Safety">Safety</a></li>
<li><a href="/Team:KIT-Kyoto/Test/Attributions">Attributions</a></li>
<li><a href="/Team:KIT-Kyoto/Test/Attributions">Attributions</a></li>
Line 26: Line 26:
<script type="text/javascript">
<script type="text/javascript">
$(function(){
$(function(){
-
     var device = function(){
+
     var ua = navigator.userAgent;
-
    var mw = $(window).width();
+
if(ua.indexOf('iPhone') > 0 || ua.indexOf('Android') > 0 || ua.indexOf('BlackBerry') > 0 || ua.indexOf('Windows Phone') > 0){
-
    if(mw >= 568){
+
$(".m_menu").css("display","none");
-
        $("#mobilemenu").removeClass('menu-active').css("display","none");
+
-
        $(".accordion").removeClass('m-active');
+
-
    }else {
+
-
        $("#mobilemenu").addClass('menu_active').show();
+
-
        $(".accordion").addClass('m-active');
+
-
        $(".ac").eq(0).show();
+
-
    }
+
-
    }
+
-
$(function(){
+
-
    device();
+
-
    $(window).resize(device);
+
-
});
+
-
});
+
-
$(function(){
+
-
        $(".m_menu").hide();
+
$(".button-toggle").on("click", function() {
$(".button-toggle").on("click", function() {
$(".m_menu").slideToggle();
$(".m_menu").slideToggle();
Line 52: Line 37:
               else {top.fadeIn ();}
               else {top.fadeIn ();}
        });
        });
 +
}
});
});
$(function(){
$(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');
 +
$(".ac").eq(0).show();
 +
}
$(".m-active h2 a").click(function(){
$(".m-active h2 a").click(function(){
var num = $(".m-active h2 a").index(this);
var num = $(".m-active h2 a").index(this);
Line 62: Line 53:
}else {
}else {
ac.slideUp();
ac.slideUp();
-
}
+
}  
-
});  
+
});
});
});
</script>
</script>
Line 159: Line 150:
background: #333;
background: #333;
}
}
-
 
+
.accordion input{
 +
display:none;
 +
}
@media screen and (max-width: 568px) {
@media screen and (max-width: 568px) {
-
div.menu_active{
 
-
display:inline;
 
-
}
 
div#mobilemenu{
div#mobilemenu{
display:inline;
display:inline;
Line 287: Line 277:
.member_img_profile a,.member_img_profile span{
.member_img_profile a,.member_img_profile span{
padding:10px 5px 10px 45px;
padding:10px 5px 10px 45px;
-
}
 
-
 
-
.m_table{
 
-
overflow:scroll;
 
}
}

Revision as of 16:22, 3 October 2014