Difference between revisions of "Template:Kyoto"

Line 556: Line 556:
 
#menu_content { display:block;}
 
#menu_content { display:block;}
 
.menu_button.direct_to_page {padding-left: 17px;}
 
.menu_button.direct_to_page {padding-left: 17px;}
+
}
+
 
 +
}
  
 
/* IF THE SCREEN IS LESS THAN 800PX */
 
/* IF THE SCREEN IS LESS THAN 800PX */
Line 572: Line 573:
 
.menu_bottom_padding {display:none;}
 
.menu_bottom_padding {display:none;}
 
.menu_button.direct_to_page { padding-left: 36px; }
 
.menu_button.direct_to_page { padding-left: 36px; }
}
+
 +
        <script>
 +
var pc_width = 1080;
 +
var device = (screen.width < 600 ? 'sp' : 'pc');
 +
var view_mode = (device == 'pc' || document.cookie.indexOf('view_mode=pc') != -1 ? 'pc' : 'sp');
 +
if (device == 'sp' && view_mode == 'pc') {
 +
    document.getElementsByName('viewport')[0].setAttribute('content', 'width=' + pc_width + ',initial-scale=1');
 +
}
 +
 
 +
$(function () {
 +
    if (device == 'sp') {
 +
        if (view_mode == 'pc') {
 +
            $('.sp-mode').on('click', function () {
 +
                var date = new Date();
 +
                date.setTime(0);
 +
                document.cookie = 'view_mode=;expires='+date.toGMTString();
 +
                location.reload(false);
 +
            }).show();
 +
        } else {
 +
            $('.pc-mode').on('click', function () {
 +
                document.cookie = 'view_mode=pc';
 +
                location.reload(false);
 +
            }).show();
 +
        }
 +
    }
 +
});
 +
</script>
 +
 
 +
 
 +
 
 +
   
 +
        }
  
  

Revision as of 05:07, 8 October 2018