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

onfocus and onmouseover

I have a menu on my site, which consists of a <ul> of <li>s. Some of
these <li>s contain a <a href="..."> that points directly to a page,
other <li>s contain a new <ul> of links.

Users without JavaScript enabled see just the lists of links (nicely
styled if they accept my CSS). For users with JS and CSS enabled, I
make the menu dynamic by hiding the sub-<li>s, and making them visible
if the mouse hovers over a <li> that contains a submenu. So the code
looks like this:

<ul>
<li><a href="foo">foo</a></li>
<li onmouseover="show('list2')" onmouseout="hide('list2')">
bar:
<ul id="list2" onmouseover="show('list2')"
onmouseout="hide('list2')">
<li><a href="bar1">bar 1</a></li>
<li><a href="bar2">bar 2</a></li>
</ul>
</li>
</ul>

Now I don't want to rely on the mouse, with events like onmouseover
and onmouseout. I would prefer to use onfocus and onblur in addition.
This is in fact one of the accessibility guidelines set up by the W3C
(http://www.w3.org/TR/WCAG10/). Although I'm not sure if I agree with
all of their guidelines, this one seems pretty reasonable.

The problem is, <li> and <ul> elements don't have an onfocus or onblur
attribute. Also, I'm not sure how well onfocus and onblur are
supported by the various browsers.

Any thoughts or suggestions would be welcome!

Garmt de Vries.
Jul 23 '05 #1
0 2334

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

Similar topics

2
by: Mike Berger | last post by:
So, I'm fairly new to this and my code is as follows... <script language="JavaScript> var oldValue function focusElement(theElement) { oldValue = theElement.value; return; } </script>
1
by: Rich Morey | last post by:
Hello, I have created a form and assigned each of the form elements to a class in a style sheet. I would like to know if it is possible to add 'OnFocus' and 'OnBlur' events to the style sheet...
1
by: Michael Albanese | last post by:
I am developing an application to handle my compay's OSHA reporting requirements. Some of the input criteria are technical and narowly defined, so I was trying to prvide what i call "Context...
2
by: Paresh Shah | last post by:
Hi Friends... I have an query on how to capture onFocus event for all the input controls without writing onFocus event in the <input> tag. say my html form has 3 or 4 or 5 input text boxes,...
2
by: swathi | last post by:
----------------------------------------------------------------------- A poll associated with this post was created, to vote and see th results, please visit...
1
by: Tzachi | last post by:
Hello all, I have a function that dynamically adds rows and columns to the page. Everything works well except onfocus // onblur attributes. For some reason, when entering the input box it...
1
by: Eric Trav | last post by:
Hello, I am using mozilla and javascript to change the style background color for my select with onfocus() and back to white with onblur(). When i process onfocus(); i have to click on the...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
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
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
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
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.