473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

dynamic menu


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;
}

/*================================================= =======
========*/

Nov 19 '05 #1
1 4248
The problem occurs because of the z-index behaviour of HTML elements.
There's some help in this article:

INFO: How the Z-index Attribute Works for HTML Elements

http://support.microsoft.com/default...EN-US;q177378&
Here's an explanation that Joseph King of Coalesys posted some time ago:

"So what that means is an IFrame can block out the select box, and be under
a
DIV at the same time. And that is how it is done. We dynamically write the
IFrame to the document, size it to the dimension of the popup DIV, and shim
between the popup DIV and the rest of the page.

There is another, more complex trick you can do. And that is to take a DIV
and copy it's inner content to the new IFrame itself, and then just start
treating the IFrame like you would have been treating the DIV. We were
doing this in our 2.0 betas, and it worked quite well. And it even works
going back to IE 4.0. However, it did require a kind of complex inter-frame
JavaScript bridge to maintain all the features in the product (Once you
write your DIV contents into the IFrame, your popup is actually a whole new
document with it's own JavaScript execution environment). Another caveat is
that in IE 5.0 and earlier, mouse over and mouse out events need to be
handled differently when the mouse is traversing frames (they don't always
fire in the expected order). So, although we had it working quite well, it
wasn't KISS. The shim technique is, so we went decided to go with that.
For IE 5.0, we continue hiding the select boxes as we have done in the
past."
"tribal boy" <an*******@discussions.microsoft.com> wrote in message
news:17****************************@phx.gbl...

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;
}

/*================================================= =======
========*/


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Macamba | last post by:
Hi all, I am currently developing a website for a voluntary organisation. It is my first step in website development. The dynamic menu I developed has some bugs, which I addressed in another...
4
by: Stromboli | last post by:
hi people, My problem is that I need to build a dynamic menu (preferably that works in all the browsers) that appears when I mouseover a certain link. The problem is that I have to declare...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: biela | last post by:
Hi I'm from Poland and I have small question :). I'm looking for sample example how to create dynamic menu. Generaly my website will see like that ------------------------------------ 2...
2
by: vikram | last post by:
I have to design a page which contains a dynamic generated menu at left side.Menu will be generated once a user log in and will remain as it is for the rest of the user session. Problem is that...
19
by: mart2006 | last post by:
I've created a dynamic drop down menu that populates itself with data from a MySQL table. What I would like to do is create a non dynamic drop down menu that alters what is shown in the dynamic menu....
3
by: RahimAsif | last post by:
I am writing an application that requires the a portion of the main menu to be dynamic. The menu has file, panels, view files and help across the top. The view files sub menu needs to be...
0
by: benfly08 | last post by:
Hi, I used SWT to develop an windows application. In the application there is a dynamic created popup menu. The dynamic part is that i will pass a list of name to be a submenu of one menu item....
10
by: mart2006 | last post by:
Hi, I'm fairly new to PHP and I've created a dynamic drop down menu that populates itself with data from a MySQL table. What I would like to do is create a non dynamic drop down menu that alters...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.