T
tribal boy
Guys,
I am using a dynamic menu which uses xml,xsl a css file
and javascript.
This works fine when there are no server controls around
or underneath it.
The problem is whenever the menu encounters a server
control, it closes itself.
How Can I get around this. I guess that the server
controls are getting rendered (refreshed) and this is
preventing the menu from being shown
I would appreciate if any one can help me out on this
please find the js & css files below
Thanks
/*===========================================*/
var eOpenMenu = null;
function OpenMenu(eSrc,eMenu)
{
eMenu.style.left = eSrc.offsetLeft +
divMenuBar.offsetLeft;
//eMenu.style.top =
divMenuBar.offsetHeight + divMenuBar.offsetTop;
eMenu.style.top = divMenuBar.offsetHeight
+ divMenuBar.offsetTop + 33 + 12;
eMenu.style.visibility = "visible";
eOpenMenu = eMenu;
}
function CloseMenu(eMenu)
{
eMenu.style.visibility = "hidden";
eOpenMenu = null;
}
function document.onmouseover()
{
var eSrc = window.event.srcElement;
if ("clsMenuBarItem" == eSrc.className)
{
eSrc.style.color = "Black";
var eMenu = document.all
[eSrc.id.replace("tdMenuBarItem","divMenu")];
if (eOpenMenu && eOpenMenu !=
eMenu)
{
CloseMenu(eOpenMenu);
}
if (eMenu)
{
OpenMenu(eSrc,eMenu);
}
}
else if (eOpenMenu && !eOpenMenu.contains
(eSrc) && !divMenuBar.contains(eSrc))
{
CloseMenu(eOpenMenu);
}
}
function document.onmouseout()
{
var eSrc = window.event.srcElement;
if ("clsMenuBarItem" == eSrc.className)
{
eSrc.style.color = "";
}
}
/*==========================================*/
*====================================================
* Styles for the dynamic menu
*====================================================*/
BODY
{
font-size: 70%;
font-family: verdana;
}
H1
{
font-size: 120%;
font-style: italic;
}
/*Background color for main navigation panel*/
DIV#divMenuBar
{
background-color: #c00000;
}
/*Main menu items and separator*/
TABLE#tblMenuBar TD
{
padding-right: 5px;
padding-left: 5px;
font-weight: bold;
font-size: 9pt;
padding-bottom: 0px;
cursor: default;
color: white;
padding-top: 0px;
font-family: Arial;
background-color: #c00000;
}
/*Used for on mouse over*/
TABLE#tblMenuBar TD.clsMenuBarItem
{
font-weight: bold;
cursor: hand;
}
DIV.clsMenu
{
padding-right: 5px;
border-top: white 1px solid;
padding-left: 8px;
font-size: 8pt;
visibility: hidden;
padding-bottom: 5px;
width: 130px;
color: white;
padding-top: 5px;
font-family: arial,helvetica;
position: absolute;
background-color: black;
}
/*All drop down items */
DIV.clsMenu A
{
font-weight: bold;
color: white;
font-size: 8pt;
font-family: arial,helvetica;
background-color: black;
text-decoration: none;
}
/*On mouse over the drop down menu items */
DIV.clsMenu A:hover
{
color: red;
}
BUTTON
{
font-size: 100%;
font-family: tahoma;
}
/*========================================================
========*/
I am using a dynamic menu which uses xml,xsl a css file
and javascript.
This works fine when there are no server controls around
or underneath it.
The problem is whenever the menu encounters a server
control, it closes itself.
How Can I get around this. I guess that the server
controls are getting rendered (refreshed) and this is
preventing the menu from being shown
I would appreciate if any one can help me out on this
please find the js & css files below
Thanks
/*===========================================*/
var eOpenMenu = null;
function OpenMenu(eSrc,eMenu)
{
eMenu.style.left = eSrc.offsetLeft +
divMenuBar.offsetLeft;
//eMenu.style.top =
divMenuBar.offsetHeight + divMenuBar.offsetTop;
eMenu.style.top = divMenuBar.offsetHeight
+ divMenuBar.offsetTop + 33 + 12;
eMenu.style.visibility = "visible";
eOpenMenu = eMenu;
}
function CloseMenu(eMenu)
{
eMenu.style.visibility = "hidden";
eOpenMenu = null;
}
function document.onmouseover()
{
var eSrc = window.event.srcElement;
if ("clsMenuBarItem" == eSrc.className)
{
eSrc.style.color = "Black";
var eMenu = document.all
[eSrc.id.replace("tdMenuBarItem","divMenu")];
if (eOpenMenu && eOpenMenu !=
eMenu)
{
CloseMenu(eOpenMenu);
}
if (eMenu)
{
OpenMenu(eSrc,eMenu);
}
}
else if (eOpenMenu && !eOpenMenu.contains
(eSrc) && !divMenuBar.contains(eSrc))
{
CloseMenu(eOpenMenu);
}
}
function document.onmouseout()
{
var eSrc = window.event.srcElement;
if ("clsMenuBarItem" == eSrc.className)
{
eSrc.style.color = "";
}
}
/*==========================================*/
*====================================================
* Styles for the dynamic menu
*====================================================*/
BODY
{
font-size: 70%;
font-family: verdana;
}
H1
{
font-size: 120%;
font-style: italic;
}
/*Background color for main navigation panel*/
DIV#divMenuBar
{
background-color: #c00000;
}
/*Main menu items and separator*/
TABLE#tblMenuBar TD
{
padding-right: 5px;
padding-left: 5px;
font-weight: bold;
font-size: 9pt;
padding-bottom: 0px;
cursor: default;
color: white;
padding-top: 0px;
font-family: Arial;
background-color: #c00000;
}
/*Used for on mouse over*/
TABLE#tblMenuBar TD.clsMenuBarItem
{
font-weight: bold;
cursor: hand;
}
DIV.clsMenu
{
padding-right: 5px;
border-top: white 1px solid;
padding-left: 8px;
font-size: 8pt;
visibility: hidden;
padding-bottom: 5px;
width: 130px;
color: white;
padding-top: 5px;
font-family: arial,helvetica;
position: absolute;
background-color: black;
}
/*All drop down items */
DIV.clsMenu A
{
font-weight: bold;
color: white;
font-size: 8pt;
font-family: arial,helvetica;
background-color: black;
text-decoration: none;
}
/*On mouse over the drop down menu items */
DIV.clsMenu A:hover
{
color: red;
}
BUTTON
{
font-size: 100%;
font-family: tahoma;
}
/*========================================================
========*/