gpt4 book ai didi

javascript - 禁用手机脚本

转载 作者:行者123 更新时间:2023-12-02 18:40:08 25 4
gpt4 key购买 nike

嗨 friend 们,我必须在手机上打开时禁用视差效果脚本。我找到了一个与我想要的类似的脚本并进行了改编,但它不起作用。有谁知道出了什么问题吗?

var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};

jQuery(document).ready(function(){
if( !isMobile.any()){
$(window).stellar(): false;
}
});

最佳答案

$(window).stellar()后面的: false是什么?我不确定你想在那里做什么,或者这只是某种复制/粘贴错误或其他什么,但这会给出:

SyntaxError: Unexpected token :

我想你想要这个:

jQuery(document).ready(function(){
if( !isMobile.any()){
$(window).stellar();
}
});

关于javascript - 禁用手机脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16918369/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com