473,406 Members | 2,867 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,406 software developers and data experts.

How to Create a popup menu

On my web site, I have a "Links" link.

Rather than create a separate HTML file listing all the links, I'd like
to create a popup menu (not sure if that's the official name or not).

So, when I click on "Links", I'd like to have a small popup menu appear
with a list of all my links, from which the user can select one.

Is there a way to do this within Javascript?
Dennis Hancy
Eaton Corporation
Cleveland, OH

Jul 23 '05 #1
2 1938
<de*********@eaton.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
On my web site, I have a "Links" link.

Rather than create a separate HTML file listing all the links, I'd like
to create a popup menu (not sure if that's the official name or not).

So, when I click on "Links", I'd like to have a small popup menu appear
with a list of all my links, from which the user can select one.

Is there a way to do this within Javascript?
Dennis Hancy
Eaton Corporation
Cleveland, OH


You might consider a drop-down list; for example:

<html>
<head>
<title>linkpick.htm</title>
<script type="text/javascript">
function link() {
var form = document.form1;
var site = form.links.options[form.links.selectedIndex].value;
if (site == "") return;
location.href = "http://" + site;
}
</script>
</head>
<body>
<form name="form1">
<b>Pick a link:</b><br>
<select name="links" onchange="link()">
<option value="" selected>
<option value="www.google.com">Google
<option value="www.yahoo.com">Yahoo
</select>
</form>
</body>
</html>

Jul 23 '05 #2
On 28 Jan 2005 07:56:13 -0800 de*********@eaton.com wrote:
On my web site, I have a "Links" link. Rather than create a separate HTML file listing all the links, I'd like
to create a popup menu (not sure if that's the official name or not). So, when I click on "Links", I'd like to have a small popup menu appear
with a list of all my links, from which the user can select one. Is there a way to do this within Javascript?

Try this little script

var kid = "FirstOn"
function ShowInfo(DivId)
{
document.getElementById(kid).style.display = 'none';
document.getElementById(DivId).style.display = 'block';
kid = DivId;
}

"FirstOn" is your opening division.
<div id="FirstOn" style="display:block;">Text</div>

Further items can be opened as needed with
<div id="item1" style="display:none;">links links links what ever</div>

Then when you want to show it, onclick="ShowInfo('item1')"

Basically works the same way as an image swap.

As an example see my site.
www.somestuff.batcave.net/menu1.html
Jul 23 '05 #3

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

Similar topics

0
by: Dan H | last post by:
I'm trying to add menu items dynamically in the Popup event of a MenuItem in an MDI child form. Actually, I'm using the Genghis MRU class, but have also dumbed it down to a simple test case in a...
2
by: SamSpade | last post by:
I use to get popup events when I checked out the menu coding. That was a while ago. Something I did in the interim must have suppressed those events because I just noticed I don't get them any...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
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...
5
by: SQACSharp | last post by:
I'm trying to automate an action in Internet Explorer.... I'm trying to click an image that open a popup menu. The html code of the iimage look like like <img blabla..OnClick="ShowMenu()"/> I...
0
by: newwin | last post by:
How i create a popup menu on switchboard form, like on switchboard form, when user clicks the button a popup menu is displayed then user can selects one of them using access 2007. Please tell me, the...
9
by: Academia | last post by:
ContextMenu has a Popup event but MainMenu does not. I need Popup with MainMenu. Do you know anyway to simulate it? Thanks in advance
2
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully...
1
by: Carl | last post by:
"Chuckk Hubbard" <badmuthahubbard@gmail.comwrites: Try creating the "main" popup menu before the sub-menus, and when instantiating the sub-menus, pass the main menu as the "master" instead of...
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: 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...
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
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...
0
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,...
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.