数码资讯
js屏幕和禁用浏览器滑块示例
复制代码代码如下所示: VaR水平= $(美元。horizontal_screen '); / /自定义横屏模式的提示方式 var =文档= $(文档); VaR的preventDefault =功能(e){ E.preventDefault(); }; VaR touchstart =功能(e){
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
复制代码代码如下所示:
VaR水平= $(美元。horizontal_screen '); / /自定义横屏模式的提示方式
var =文档= $(文档);
VaR的preventDefault =功能(e){
E.preventDefault();
};
VaR touchstart =功能(e){
document.on美元('touchstart touchmove,preventDefault);
};
VaR touchend =功能(e){
document.off美元('touchstart touchmove,preventDefault);
};
函数侦听器(类型){
如果('add= =型){
{纵向模式}
horizontal.addclass美元('hide);
document.off美元('touchstart,touchstart);
document.off美元('touchend,touchend);
其他{ }
交叉屏幕模式
horizontal.removeclass美元('hide);
document.on美元('touchstart,touchstart);
document.on美元('touchend,touchend);
}
}
功能orientationchange(){
开关(窗口方向){
{纵向模式}
案例0:
案例180:
听众('add);
打破;
交叉屏幕模式
案例90:
案例90:
听众('remove);
打破;
}
}
$(窗口),(onorientationchange 窗口orientationchange :调整
document.ready美元(函数(){()
要进入界面水平屏幕模式,建议只支持垂直屏幕。
如果(window.orientation = 90 | | window.orientation = = 90){
听众('remove);
}
});
VaR水平= $(美元。horizontal_screen '); / /自定义横屏模式的提示方式
var =文档= $(文档);
VaR的preventDefault =功能(e){
E.preventDefault();
};
VaR touchstart =功能(e){
document.on美元('touchstart touchmove,preventDefault);
};
VaR touchend =功能(e){
document.off美元('touchstart touchmove,preventDefault);
};
函数侦听器(类型){
如果('add= =型){
{纵向模式}
horizontal.addclass美元('hide);
document.off美元('touchstart,touchstart);
document.off美元('touchend,touchend);
其他{ }
交叉屏幕模式
horizontal.removeclass美元('hide);
document.on美元('touchstart,touchstart);
document.on美元('touchend,touchend);
}
}
功能orientationchange(){
开关(窗口方向){
{纵向模式}
案例0:
案例180:
听众('add);
打破;
交叉屏幕模式
案例90:
案例90:
听众('remove);
打破;
}
}
$(窗口),(onorientationchange 窗口orientationchange :调整
document.ready美元(函数(){()
要进入界面水平屏幕模式,建议只支持垂直屏幕。
如果(window.orientation = 90 | | window.orientation = = 90){
听众('remove);
}
});
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。