jQuery touchstart与IE上的nicescroll冲突
我用这段代码在左边创建一个菜单,但在IE11上不工作,只能在Firefox、Chrome、Edge和所有其他主流浏览器上工作 你能帮我吗 当我用IE 11上的classjQuery touchstart与IE上的nicescroll冲突,jquery,html,mobile,touch,Jquery,Html,Mobile,Touch,我用这段代码在左边创建一个菜单,但在IE11上不工作,只能在Firefox、Chrome、Edge和所有其他主流浏览器上工作 你能帮我吗 当我用IE 11上的class.morph主菜单按钮包装器触摸菜单时,没有显示任何内容 但是如果我双击这个图标,菜单就会显示出来 删除所有js代码后,问题是: (function($){ $(document).ready( function() { $("html").niceScroll({ cursorcolor: "#40A9F2", c
.morph主菜单按钮包装器
触摸菜单时,没有显示任何内容
但是如果我双击这个图标,菜单就会显示出来
删除所有js代码后,问题是:
(function($){
$(document).ready(
function() {
$("html").niceScroll({
cursorcolor: "#40A9F2",
cursorwidth: "12px",
cursorborder: "0px solid #000",
cursorborderradius: "3px",
scrollspeed: 90,
autohidemode: true,
background: '#ddd',
hidecursordelay: 400,
cursorfixedheight: false,
cursorminheight: 20,
enablekeyboard: true,
horizrailenabled: false,
bouncescroll: true,
smoothscroll: true,
iframeautoresize: true,
emulatetouch: false,
hwacceleration: true
});
}
);})(jQuery);
如果与触摸屏发生冲突,如何使用nicescroll
jQuery('.morph-main-menu-button-wrapper, .morph-main-menu-activator').on('touchstart touches touchend click', function(e) {
'use strict';
e.preventDefault();
if(jQuery('.morph-main-wrapper').hasClass('morph-main-wrapper-active'))
{
/* hide morph slide */
jQuery('.morph-main-wrapper').removeClass('morph-main-wrapper-active');
/* hide morph background */
jQuery('.morph-main-background').removeClass('morph-main-background-active');
/* hide background overlay */
jQuery('.morph-background-overlay').removeClass('morph-background-overlay-active');
/* hide expanded menu button */
jQuery('.morph-main-menu-button-wrapper').removeClass('morph-menu-active');
/* when menu de-activated, animate main menu items */
jQuery('.morph-menu-wrapper').removeClass('morph-menu-wrapper-active');
/* hide search field close button */
jQuery('.morph-search-close-wrapper').removeClass('morph-search-close-wrapper-active');
/* hide search field */
jQuery('.morph-search-wrapper').removeClass('morph-search-wrapper-active');
jQuery('.morph-search-wrapper #searchform #s').blur();
/* show search button */
jQuery('.morph-search-button').removeClass('morph-search-button-hidden');
/* hide secondary menu */
jQuery('.morph-secondary-menu-wrapper').removeClass('morph-secondary-menu-wrapper-active');
/* secondary menu button inactive state */
jQuery('.morph-secondary-menu-button').removeClass('morph-secondary-menu-button-active');
} else {
/* show morph slide */
jQuery('.morph-main-wrapper').addClass('morph-main-wrapper-active');
/* show morph background */
jQuery('.morph-main-background').addClass('morph-main-background-active');
/* show background overlay */
jQuery('.morph-background-overlay').addClass('morph-background-overlay-active');
/* hide expanded menu button */
jQuery('.morph-main-menu-button-wrapper').addClass('morph-menu-active');
/* when menu activated, animate main menu items */
jQuery('.morph-menu-wrapper').addClass('morph-menu-wrapper-active');
}
});
由于不应用样式存在问题,这让我相信CSS中有一些东西没有在IE中呈现。javascript本身看起来很好,应该会在所有事件中触发。尝试添加触控功能以更加安全 还可以使用$引用jquery,使
jQuery('.morph-menu-wrapper').removeClass('morph-menu-wrapper-active');
变成
$('.morph-menu-wrapper').removeClass('morph-menu-wrapper-active')代码>版本3.7.3修复了触摸问题
没有,但如果我双击此图标,菜单就会显示出来!只有单触不起作用,双触=右键单击我想在触摸设备上确定问题是nicesrol(函数($){$(文档)。ready(函数(){$(“html”)。nicesroll({cursorcolor:#40A9F2),cursorwidth:“12px”,cursorborder:“0px solid#000”,cursorborderradius:“3px”,scrollspeed:90,autohidemode:true,background:'#ddd',hidecursordelay:400,cursorfixedheight:false,cursorminheight:20,enablekeyboard:true,horizrailenabled:false,bouncescroll:true,smoothscroll:true,iframeautoresize:true,emulatetouch:false,hAcceleration:true})(jQuery);