2016-04-15 46 views

回答

0

我最近遇到过这种类型的问题。

所以我使用了mouseenter,mouseleave事件。

$(".menu-open") 
    // not necessary 
    .mouseenter(function() { 
    $(this).show(); 
    }) 
    // you must put this to hide menu when user leaves the menu 
    .mouseleave(function() { 
    $(this).hide(); 
    }); 

那么通过使用上面的代码,只要用户将光标移出菜单,就会隐藏菜单。

这对用户来说也是相当不错的体验,就像他们不关心菜单在不需要的时候关闭一样。但如果它将保持打开状态,除非用户再次点击菜单关闭它,所以感到奇怪。

就像我给你的一样, link.

或者您可以使用滚动事件,例如用户向下滚动到特定值,您可以检查菜单是否打开,然后您可以隐藏它。

+0

谢谢你的建议。但同样的tinymce ediotor在这个页面上工作正常https://www.tinymce.com/docs/demo/classic/。请检查一下 –

相关问题