473,385 Members | 1,384 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,385 software developers and data experts.

Toggling display problems

Hi all,

I have a page in which I display a menu which is a table within a div
element. Each cell in the table is a menu item with an "onclick" event
handler assigned.

I want to make it so that whenever the user clicks outside of the menu, the
menu is hidden. The only way I can see of doing this is using the
"ondeactivate" event for the table/div, but whenever I handle this event it
swallows the "onclick" event for the menu items, rendering the menu useless.

Is there an easier way of doing this? Any help would be much appreciated.

Cheers,

Jamie
Jul 20 '05 #1
6 1768
On Thu, 29 Jan 2004 11:43:48 +1300, Jamie <ja***@nospam.com> wrote:
Hi all,

I have a page in which I display a menu which is a table within a div
element. Each cell in the table is a menu item with an "onclick" event
handler assigned.

I want to make it so that whenever the user clicks outside of the menu,
the
menu is hidden. The only way I can see of doing this is using the
"ondeactivate" event for the table/div, but whenever I handle this event
it
swallows the "onclick" event for the menu items, rendering the menu
useless.

Is there an easier way of doing this? Any help would be much appreciated.

Cheers,

Jamie

How do you propose the visitor knows the menu is there in the first place?
If the menu disappears, will they be able to get it back? Sounds to me at
this point it's only going to drive your visitors up a tree...
Jul 20 '05 #2
"Neal" <ne*****@spamrcn.com> wrote in message
news:op**************@news.rcn.com...
On Thu, 29 Jan 2004 11:43:48 +1300, Jamie <ja***@nospam.com> wrote:
Hi all,

I have a page in which I display a menu which is a table within a div
element. Each cell in the table is a menu item with an "onclick" event
handler assigned.

I want to make it so that whenever the user clicks outside of the menu,
the
menu is hidden. The only way I can see of doing this is using the
"ondeactivate" event for the table/div, but whenever I handle this event
it
swallows the "onclick" event for the menu items, rendering the menu
useless.

Is there an easier way of doing this? Any help would be much appreciated.
Cheers,

Jamie

How do you propose the visitor knows the menu is there in the first place?
If the menu disappears, will they be able to get it back? Sounds to me at
this point it's only going to drive your visitors up a tree...


It's a context menu that displays when the user right-clicks on an icon. We
have limited real estate, so it was the best option...

Cheers,

Jamie
Jul 20 '05 #3
in post: <news:bv**********@lust.ihug.co.nz>
"Jamie" <ja***@nospam.com> said:
I have a page in which I display a menu which is a table within a div
element. Each cell in the table is a menu item with an "onclick" event
handler assigned.
I want to make it so that whenever the user clicks outside of the menu, the
menu is hidden.


doesn't sound very user friendly. KISS
--
brucie - i usenet nude
Jul 20 '05 #4
brucie wrote:
in post: <news:bv**********@lust.ihug.co.nz>
"Jamie" <ja***@nospam.com> said:

I have a page in which I display a menu which is a table within a div
element. Each cell in the table is a menu item with an "onclick" event
handler assigned.
I want to make it so that whenever the user clicks outside of the menu, the
menu is hidden.

doesn't sound very user friendly. KISS


<SMOOCH>
Matthias

Jul 20 '05 #5
in post: <news:bv************@ID-16734.news.uni-berlin.de>
Matthias Gutfeldt <sa************@gmx.net> said:
doesn't sound very user friendly. KISS
<SMOOCH>


@)>-`--,--'-- x 12

--
brucie - i usenet nude
Jul 20 '05 #6
On Thu, 29 Jan 2004 18:30:06 +1000, brucie <sh**@bruciesusenetshit.info>
declared in comp.infosystems.www.authoring.html:
in post: <news:bv************@ID-16734.news.uni-berlin.de>
Matthias Gutfeldt <sa************@gmx.net> said:
KISS

<SMOOCH>


@)>-`--,--'-- x 12


This is a *public* newsgroup, guys. Take it elsewhere, please. :-)

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 20 '05 #7

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

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
1
by: Tristan Miller | last post by:
Greetings. I am trying to write a function which toggles the display of a certain class of <div> elements in an HTML page. The CSS file initially sets some classes to "display: none", and...
6
by: Dr John Stockton | last post by:
I see, quite often, code like if (tmp.style.display == 'none') tmp.style.display = 'block'; else if (tmp.style.display == 'block') tmp.style.display = 'none'; or if (tmp.style.display ==...
13
by: Gunnar | last post by:
Hello, I am running into problems with a simple function which should change the style.display properties from 'block' to 'none'. I am able to change them from 'none' to 'block' as expected. ...
5
by: Lyn | last post by:
Hi, I have a form which contains a number of subforms in different pages of a tab control. In the detail section of each subform, I list records related to the main form record, but from...
1
by: siaj | last post by:
Hello all,, I want to have a page where I can have two images shown alternately in a image control. The image should keep toggling Any link or sample code will be appreciated.
1
by: Jesse Aufiero | last post by:
I have an MDI application with two maximized child forms. At any given time only one of the child forms is in the foreground and visible. To alternate between the two child forms, I can type...
1
by: Bob | last post by:
Hi, Hope you can help me with this one. I'm at my wits end. I'm trying to create an intelligent edit-box like the excellent "Customer" one at the URL: ...
4
by: plumba | last post by:
Let me explain.... I have a form (most of which you guys have helped me with!!). The initial problem I was having is that it was holding the data in the fields after submit, I resolved this by...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.