我使用此代码在左侧创建菜单但在IE 11上无法正常工作,仅适用于Firefox,Chrome,Edge和所有其他主要浏览器。
请你能帮帮我吗?
当我触摸IE 11上的类.morph-main-menu-button-wrapper
没有显示任何内容的菜单时。
但是,如果我对此图标进行双击,则会显示菜单!
删除所有js代码后问题是nicescrool:
(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);
如果与touch发生冲突,如何使用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');
}
});
答案 0 :(得分:0)
由于没有应用这种风格的问题导致我相信你的CSS中有些东西没有在IE中呈现。你的javascript本身看起来很好,应该触发所有事件。尝试添加触摸更加安全。
你也可以使用$来重新发现jquery,制作
jQuery('.morph-menu-wrapper').removeClass('morph-menu-wrapper-active');
成为
$('.morph-menu-wrapper').removeClass('morph-menu-wrapper-active');
答案 1 :(得分:0)
版本3.7.3修复了触摸问题!