“检测操作系统x”;“自然滚动方向”;在Chrome&;FF使用javascript/jQuery
我面临一个问题。我试图检测OSX用户在使用chrome或FF时是否启用了“自然滚动方向”。目前,如果用户使用以下代码在Safari上,我可以检测到它“检测操作系统x”;“自然滚动方向”;在Chrome&;FF使用javascript/jQuery,javascript,jquery,google-chrome,firefox,operating-system,Javascript,Jquery,Google Chrome,Firefox,Operating System,我面临一个问题。我试图检测OSX用户在使用chrome或FF时是否启用了“自然滚动方向”。目前,如果用户使用以下代码在Safari上,我可以检测到它 $("html, body").bind({'mousewheel DOMMouseScroll onmousewheel touchmove scroll': function(e, delta) { if(Object.prototype.toString.call(window.HTMLElement).indexOf('Constructo
$("html, body").bind({'mousewheel DOMMouseScroll onmousewheel touchmove scroll': function(e, delta) {
if(Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0) {
if(e.originalEvent.webkitDirectionInvertedFromDevice) {
this.scrollTop += (delta);
e.preventDefault();
}
}}});
这个stackoverflow页面只为safari提供了上述解决方案
是否有可能使用chrome&FF进行检测。我之所以需要它,是因为我想强制用户以“反向滚动方向”滚动,换句话说,当用户向下滚动时,我需要页面向下滚动
非常感谢您的帮助!:)