Re: JAVASCRIPT rollovers

> 
[ re-wrapped to proper line lengths ]
> Our designers are often asked to develop interfaces that feature
* rollovers using JAVASCRIPT. One of the popular requests is for
* the rollover effect to display a list of items which expands on the

This is two different scripting actions - rollover and popup menu.
The rollover part violates the don't generate popups guideline.

This is quite a common behaviour that designers think should have been
in HTML (really it is styling, not HTML) but is not.  I must read up on
CSS3 sometime, but I don't think it is in there.  A browser could do it on
the table of contents generated from Hn elements used correctly, but they
generally treat the entries in the contents as pointing to the heading,
not what the heading points to.  I'd suggest they are using HTML for the
wrong reasons; the requirement is too far from the true capabilities of
HTML (as against the capabilities of particular versions of MSIE).

* find the deeper links by rolling over each button and viewing the list

They've thrown in graphics as an added complication!  (We now have 
graphic links, rollovers and popups!)

* of links associated with each button.

> The alt attribute could work but would be an unacceptable length for

Alt will not work as alt cannot contain markup.

Object would work for the graphics if object worked, but object, on its
own will not work when you throw in scripting, so some care would be
needed even if you served alternative content to browsers with broken
object implementations.

* alt text. Longdesc is not supported by all browsers. Any ideas?

This is not longdesc; any use of longdesc here would be abusing that
attribute.  If you treat the graphic as a link it needs to be a
real link, not a longdesc one.

Once they have covered the question of actively opting into popups++, 
rather than having to try to opt out of them, my view would be that
they should structure the page as nested lists, style them to display
fully expanded, then, on loading, have their scripting determine whether
the browser is capable of doing what they want to do (caveat, many pages
break on Netscape 6 because designers get this step wrong) and collapse
out the list using the styles (I hope you can tell if styles are on by
reading back the computed style for an element, but some browsers may not
have this in their object model and some might compute the value and
then ignore it with styles off!).

More drastically, you could structure the page with properly nested
headings and either add divisions to allow the scripting to collapse
the structure, or re-write the HTML using the facilities in modern
browsers to regraft branches in the document tree.  (This is almost
a general XML solution, but with the input language XHTML.)

++ Note they need to cover this even when browsers enable popups to
be disabled.

Received on Wednesday, 13 March 2002 02:46:45 UTC