父菜单消失 [英] Parent Menu Disappears
问题描述
大家好,
我有一个ASP.Net菜单,该菜单在单击树视图的每个树节点时会水平显示.
它具有子菜单,并且显示正确.
问题是当我在子菜单上时,父菜单消失并且仅显示子菜单.
有人可以帮帮我吗!
Lucy
Hi All,
I have a ASP.Net menu that appears horizontally on click of each tree node of a treeview.
It has got sub menus and it is displaying properly.
The problem is when i am on the sub menus, the parent menu disappears and the sub menu only is displaying.
Can somebody please help me!!
Lucy
推荐答案
您的Menu代码库中有一些问题.调查一下.如果您没有得到它,而只需要对该菜单控件进行修复,请尝试发布重要的代码片段以供查看.
否则,您可以查看在codeproject上发布的许多菜单控件之一.选择一个适合您的.
例如:
ASP.NET水平菜单控件 [非常兼容的DHTML菜单ASP.NET用户控件 [
There is some issue in your codebase of Menu. Look into that. If you don''t get it and need a fix on that menu control only, try posting important snippets of it to look at.
Otherwise, you can have a look at one of many Menu controls present published here at codeproject. Pick the one that suits you.
For example:
ASP.NET Horizontal Menu Control[^]
Very Compatible DHTML Menu ASP.NET User Control[^]
感谢您的回复Sandeep! !
以下是我的代码:
Javascript:
Thanks for the reply Sandeep!!
Following is my code:
Javascript:
function showhide(obj,onlink,arg)
{
targetObject = document.getElementById(obj).style;
globalObject = targetObject;
if(onlink)
{
clearTimeout(ourTimer);
for (i=0; i < menuArray.length; i++)
{
var tempObject = document.getElementById(menuArray[i]).style;
tempObject.visibility = "hidden";
}
targetObject.visibility = 'visible';
targetObject.position = "absolute";
var x = getPosition(event).x;
var y = getPosition(event).y;
if (y > 490 && y < 590)
{
targetObject.top = getPosition(event).y - 90;
targetObject.left = getPosition(event).x;
}
else
{
targetObject.top = getPosition(event).y;
targetObject.left = getPosition(event).x;
}
isActive = true;
}
else
{
isActive = false;
layerTimer();
}
}
ASP.Net:
ASP.Net:
<asp:Menu ID="menuHover" BackColor="LightCyan" runat="server" DisappearAfter="900"
style="visibility:hidden; position:absolute; top:0; left:0; z-index: 999;">
<Items>
<asp:MenuItem Text="Option1" Value="Option1" >
<asp:MenuItem Text="Option 1.1" Value="test1"></asp:MenuItem>
<asp:MenuItem Text="Option 1.2" Value="test2"></asp:MenuItem>
<asp:MenuItem Text="Option 1.3" Value="test3"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Option2" Value="Option2" ></asp:MenuItem>
<asp:MenuItem Text="Option3" Value="Option3">
<asp:MenuItem Text="Option 3.1" Value="Option 3.1"></asp:MenuItem>
<asp:MenuItem Text="Option 3.2" Value="Option 3.2"></asp:MenuItem>
<asp:MenuItem Text="Option 3.3" Value="Option 3.3"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Option4" Value="Option4"></asp:MenuItem>
</Items>
</asp:Menu>
这是一个非常简单的菜单结构,其中ShowHide()函数用于在鼠标悬停时填充菜单.
但是当我在子菜单上时,n如果我们将鼠标悬停在子菜单上一段时间,则会显示父菜单.
如果可以的话请帮帮我!
露西
This is a very simple menu structure n the ShowHide() function is used to populate the menu on mouseover.
But when i am on the sub menus, n if we keep the mouse over the sub menu for some time, the parent menu is displaying.
Please help me, if possible!!
Lucy
您是否已在所有浏览器上对其进行了检查?
我认为是与样式有关的问题.
如果您更改样式或背景色
的菜单控件,则可以解决您的问题.
Have u check it on all browser?
I think its style related problem.
if u change the style or backcolor
of menucontrol then it can solve ur problems.
这篇关于父菜单消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!