1
我有一個響應WordPress site,我的客戶希望在移動設備上的選項查看全尺寸,選擇退出響應選項的網站。現在有一個傢伙程序員的幫助在這裏,我得到這個:響應或在手機上全尺寸
<script>
var yetVisited = localStorage['visited'];
if (!yetVisited) {
// open popup
localStorage['visited'] = "yes";
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
var answer = confirm('Would you like to switch to the mobile version of Klofficerent');
if (answer) {
console.log('yes');
} else {
console.log('cancel');
viewport = document.querySelector("meta[name=viewport]");
viewport.setAttribute('content', 'width=device-width, initial-scale=0, maximum-scale=1.0, user-scalable=0');
}
}
}
</script>
它那種工作,每當我訪問鏈接kunkka.oni.cc,我的網站轉向響應移動,但它不會保存該設置時我點擊其他頁面,我需要它。任何人有任何想法?
你能爲我解釋:( – 2015-04-04 06:12:16