[thelist] JS: Arg! Netscape 4.7 & site check.

Richard Bennett richard.bennett at skynet.be
Fri Nov 23 18:47:32 CST 2001


Hi,
----- Original Message -----
From: "Frank" <framar at interlog.com>
To: <thelist at lists.evolt.org>

> >  The roll-over script could be a lot more compact - but
> >  it works ok.
>
> Can you offer an example of what that would look like? You probably
> mean the way that I've initialized and assigned the alternate image
> values, right?
Wel yes, you could load the names in an array, and feed them to a function
to preload the images.

Also links like this:
onmouseover="imageChange('Home','HomeOn','TagLine','TagLine')"
can be condensed to something like this:
onmouseover="iC('Home','TagLine')"

You can also reason that a mouse-over will always be followed by a mouse-out
from the same link,
so remember which image-source was in use originally, and change it back to
this onmouse-out.
Your mouse-out code in each link could then be :
onmouseout="iC()"

It's all a matter of preference, I prefer concise, but verbose is more
readable.

> >  Aside from that the page looks nice, the code is
> >  well-laid out, if a little verbose, [..]
>
> Can you offer an example of what you are looking at when you mention
> that?
See above.
Purely a question of preference though.

> >  [...] I guess all the roll-over stuff could be done with
> >  text/css
>
> I've seen DreamWeaver sites do that. What would you consider the
> advantages of using CSS for this purpose? Are you thinking of
> toggling the visibility of the divs on and off, or were you thinking
> of another approach?
There are various techniques to use, the easiest is:
<style>
.mymenu{
     font-family: sans-serif;
     color: seagreen;
     font-weight: 800;
     text-decoration: none;
 }
a:hover.mymenu{color: orange;}
</style>
and then:
<a href="home.html" class="mymenu">Home</a>

That more or less replicates your menu items, it loads faster, needs no
image-editing, needs no javascript, is very search-engine friendly, works in
all browsers even if javascript or images are not activated (although the
orange highlight won't show in NS4). And if the browser doesn't support CSS
the link will still show and work normally.

Of course you would still need some javascript to show/hide the tagline, so
you would loose much of the advantage.

> >  There's quite a few minor syntax errors in there though.
> >  (capitalization etc)
>
> Now *this* I'm quite surprised at, especially when I go out of my way
> to use the validator. Can offer some examples?
Yeah, that was maybe an unfair comment, as you are validating 4.0
transitional, and in that case there are no immediate errors.
I've been aiming at XHTML validation lately, or at least trying to make a
habit of quoting values, and using lower-case for attributes and tags, and
closing all tags, like this <br /> .
I that context I noticed a few irregularities, - that was more force of
habit than anything else.

Cheers,
Richard Bennett.






More information about the thelist mailing list