473,729 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,e Menu)
{
eMenu.style.lef t = eSrc.offsetLeft +
divMenuBar.offs etLeft;
//eMenu.style.top =
divMenuBar.offs etHeight + divMenuBar.offs etTop;

eMenu.style.top = divMenuBar.offs etHeight
+ divMenuBar.offs etTop + 33 + 12;

eMenu.style.vis ibility = "visible";
eOpenMenu = eMenu;
}

function CloseMenu(eMenu )
{
eMenu.style.vis ibility = "hidden";
eOpenMenu = null;
}

function document.onmous eover()
{
var eSrc = window.event.sr cElement;
if ("clsMenuBarIte m" == eSrc.className)
{
eSrc.style.colo r = "Black";
var eMenu = document.all
[eSrc.id.replace ("tdMenuBarItem ","divMenu" )];
if (eOpenMenu && eOpenMenu !=
eMenu)
{
CloseMenu(eOpen Menu);
}
if (eMenu)
{
OpenMenu(eSrc,e Menu);
}
}
else if (eOpenMenu && !eOpenMenu.cont ains
(eSrc) && !divMenuBar.con tains(eSrc))
{
CloseMenu(eOpen Menu);
}
}

function document.onmous eout()
{
var eSrc = window.event.sr cElement;
if ("clsMenuBarIte m" == eSrc.className)
{
eSrc.style.colo r = "";
}
}

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

*============== =============== =============== ========
* 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#tblMenuBa r 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#tblMenuBa r TD.clsMenuBarIt em
{
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 4297
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*******@disc ussions.microso ft.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,e Menu)
{
eMenu.style.lef t = eSrc.offsetLeft +
divMenuBar.offs etLeft;
//eMenu.style.top =
divMenuBar.offs etHeight + divMenuBar.offs etTop;

eMenu.style.top = divMenuBar.offs etHeight
+ divMenuBar.offs etTop + 33 + 12;

eMenu.style.vis ibility = "visible";
eOpenMenu = eMenu;
}

function CloseMenu(eMenu )
{
eMenu.style.vis ibility = "hidden";
eOpenMenu = null;
}

function document.onmous eover()
{
var eSrc = window.event.sr cElement;
if ("clsMenuBarIte m" == eSrc.className)
{
eSrc.style.colo r = "Black";
var eMenu = document.all
[eSrc.id.replace ("tdMenuBarItem ","divMenu" )];
if (eOpenMenu && eOpenMenu !=
eMenu)
{
CloseMenu(eOpen Menu);
}
if (eMenu)
{
OpenMenu(eSrc,e Menu);
}
}
else if (eOpenMenu && !eOpenMenu.cont ains
(eSrc) && !divMenuBar.con tains(eSrc))
{
CloseMenu(eOpen Menu);
}
}

function document.onmous eout()
{
var eSrc = window.event.sr cElement;
if ("clsMenuBarIte m" == eSrc.className)
{
eSrc.style.colo r = "";
}
}

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

*============== =============== =============== ========
* 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#tblMenuBa r 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#tblMenuBa r TD.clsMenuBarIt em
{
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
2499
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 post. In this post I want to ask you why my code behaves differently in IE, while it behaves like I expect in Mozilla and Opera. What I would like to see addressed is what I need to do to get the same behaviour in all 3 browsers. I know each browser...
4
5191
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 the menu content in the same part of the page where the menu goes (BODY). The content of the page is generated dynamically so I can't put the menu content it on the headers.
1
17669
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 Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
1
1377
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 ---------|--------------|----------- | | 1 | 3 | 4 | |
2
1762
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 due to client requirement i have to avoid using frames and hence menu and the page will be a single page. So is there is any way by which the left hande side menu block can be cached someway so that dynamic generation can be avoided each time...
19
258996
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. For example, the first menu has three cities London, Paris, New York. If I choose London it populates the second menu with people from London. Here is the code I have for my dynamic menu <td valign=top><strong>Name:</strong></td> <td>...
3
4793
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 dynamically generated, and the dynamic generation needs to occur right when the user selects this menu item (that is on the Popup event handler). However, everytime I put following code on the Popup event handler (of the View Files menuitem) to dynamically...
0
4538
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. However, when I code selection event, i cannot access to the list i pass in. Anybody got idea? Below is the code. public static void setUpMenu(final Shell shell, Menu popUpMenu, final String clientId) { myShell = shell; ...
10
57040
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 what is shown in the dynamic menu. For example, the first menu has three cities London, Paris, New York. If I choose London it populates the second menu with people from London. Here is the code I have for my dynamic menu <td...
0
8917
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8148
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.