Re: <PRELOAD> in <HEAD> section, MOUSEOVER attribute in <A> tag

At 2000-12-03T20:36-0800, Steve Nichols wrote:-

> JavaScript's mouseOver effect and the A:Hover effect of Cascading Style
> Sheets have become so commonplace that I feel they deserve their own HTML
> tags and parameters. This would eliminate unnecessary JavaScripting and
> save web designers a lot of hassle. In order to achieve this, I propose the
> following plan:

HTML is now (and was originally) about communicating content, not
presentation. Your suggestions seem to run against this. If scripting
associated with a web page is unnecessary (as it usually is), then the
document ought to be equally usable without it, so that it will not matter
if the reader's browser ignores it for one reason or another.

Furthermore, the extra functionality you describe would require an
additional browser option if the user is to be able disable it. Any
browser which allows scripting has [should have] a way to turn it off; in
CSS, :hover styles can be overridden by an !important rule in the user
style sheet. Requiring an extra toggle can only make extra difficulty for
the reader.

Is the hassle for web designers at the moment really that great? How do
the costs and benefits for designers and readers (who are in the majority)
compare? (Personally, I feel that if authors spent a little less time on
JavaScript, pretty animation and other ornamentation, and a little more on
accessibility and semantic accuracy, then the WWW would be a nicer place.)

[...]
> <PRELOAD> which would be placed within the <HEAD>...</HEAD> section. The
> tag would contain the URLs of each image that are to be stored using a
> comma as the list separator. The code would look as follows:

This is already possible in HTML, and not just for images. See
<http://www.w3.org/TR/html401/struct/objects.html#h-13.3.4>

> <PRELOAD img1="/imgs/img1.jpg", img2="/imgs/img2.jpg", img3="imgs/img3.jpg">

It certainly can't be done this way, as all attribute names have to be
present in the DTD (or XML schema). It would probably be easier to use one
element per object.

[...]
> <A HREF="link.html" MOUSEOVER="img1"><IMG SRC="imgs/img0.jpg" ALT="Click
> Me!></A>
> 	The above tag would render a graphical link that, in the event of the
> user's cursor rolling over it, would be replaced by the image that was
> assigned the name img1 in the <PRELOAD> tag.

This sort of thing isn't too hard too do in e.g. JavaScript/ECMAScript.
Interestingly, it looks reasonably likely that it will be achievable even
more easily in CSS3, with something like 'content: url("imgs/img1.jpg")'
(or even url("#img1"), using an OBJECT declaration).

> <A HREF="link.html" MOUSEOVER="Style1">Text goes here.</A>
> 	The above tag would render a link that, in the event of the user's cursor
> rolling over it, would obtain the properties of the pre-defined A:Hover
> attribute of the CSS style Style1.

Why not just replace MOUSEOVER="Style1" with class="Style1" and use a CSS
rule with a selector like 'A.Style1:hover'?

> [Replacing image with text or vice versa]

I'm not sure this is something I would want to do. It would look
distinctly odd, and the browser might have to do significant work to
reflow the page as the pointer moved in and out of the affected box.
Especially if that reflowing changed whether or not the pointer was over
the element....

If you really want to do it, a smidgen of scripting and 'display: none'
should do the trick within existing standards. The less you add to the
standards, the less you have to persuade developers to implement.


Tim Bagot
-- 
pre-emptively donning asbestos underwear...

Received on Sunday, 3 December 2000 22:23:35 UTC