Css 家长在剑道UI上下文菜单上失去焦点
我在我的页面上悬停了侧边栏,其中有使用搜索过滤器的链接。每个链接都有click listener,它会打开剑道UI上下文菜单,用于当前链接的某些操作。当我打开剑道上下文菜单时,侧边栏的悬停消失了。当用户鼠标进入上下文菜单时,如何保持侧边栏的焦点 JavaScriptCss 家长在剑道UI上下文菜单上失去焦点,css,kendo-ui,contextmenu,sidebar,jquery-hover,Css,Kendo Ui,Contextmenu,Sidebar,Jquery Hover,我在我的页面上悬停了侧边栏,其中有使用搜索过滤器的链接。每个链接都有click listener,它会打开剑道UI上下文菜单,用于当前链接的某些操作。当我打开剑道上下文菜单时,侧边栏的悬停消失了。当用户鼠标进入上下文菜单时,如何保持侧边栏的焦点 JavaScript $(document).ready(function() { $('#nav').hover(function(){ $(this).animate({width:'200px'},150); },
$(document).ready(function() {
$('#nav').hover(function(){
$(this).animate({width:'200px'},150);
},function(){
$(this).animate({width:'35px'},150);
});
$("#menu").click(function(e) {
var menuHtml = $("#menu-template").html();
$(menuHtml).kendoContextMenu({
target: $(e.currentTarget),
close: function() {
this.destroy();
},
select: function(e) {
var sel = $(e.item).attr('id');
}
}).data("kendoContextMenu").open();
});
});
HTML
<div id="nav">
<ul>
<li><a id="menu">Click here</a></li>
</ul>
</div>
<script id="menu-template" type="text/x-kendo-template">
<ul>
<li id='rename'>Rename</li>
<li id='delete'>Delete</li>
</ul>
</script>
我也遇到过类似的问题,我用一种丑陋但有效的方式解决了它:
$(menuHtml).kendoContextMenu({
...
activate: function(e) {
$('#nav').prepend($(e.item).parent());
}
});
更新的JSFIDLE:
$(menuHtml).kendoContextMenu({
...
activate: function(e) {
$('#nav').prepend($(e.item).parent());
}
});