[thelist] help needed with javascript rollovers/IE error message

martin.p.burns at uk.pwcglobal.com martin.p.burns at uk.pwcglobal.com
Mon Jan 22 05:42:31 CST 2001


Memo from Martin P Burns of PricewaterhouseCoopers

-------------------- Start of message text --------------------

Alisa

If all you want to do is have the bold text happen when the user
hovers over the link, why not achieve:
* Better accessibility
* Better cross-browser compatibility
* Lower download time
* Less chance of JS errors

by doing it with normal text and CSS?

Here's how.

Make all the links normal text, rather than images, like this:
<a href="sponsors.html">Sponsors</a>

Boring, normal text, right? Here's the clever bit. You put this
in the head section:
<link rel="stylesheet" href="/resources/general.css">
Change the nav links to:
<a href="sponsors.html" class="nav">Sponsors</a>
Then add a file called general.css in the /resources folder
(http://www.styleworks.org/resources/general.css) which
contains the following:
A:LINK.nav  {
         color: Black;
         font-size : 18pt ;
     text-align : right;
     font : Arial, Helvetica;

        }

A:HOVER.nav {
         font-weight : bold;
        }

Hey presto - instant rollovers, without JavaScript.

Take a look at my site: http://www.easyweb.co.uk/
Take a look at the HTML - no <font> tags at all. Note
the rollovers... The stylesheet is at
http://www.easyweb.co.uk/resources/general_small.css
(actually, there are 3 versions of this with different font sizes,
see
http://evolt.org/article/view/17/4415/index.html
http://evolt.org/article/view/22/253/evolt.org
to see how that's done)

Cheers
Martin







Please respond to thelist at lists.evolt.org
To:   thelist at lists.evolt.org
cc:


Subject:  [thelist] help needed with javascript rollovers/IE error message



I'm working on a little site for a friend's non-profit.  It's up in test
form at
http://www.styleworks.org/test_for_Jan19/default.htm
(A few of the pages are haven't been created yet, so some of the links don't
work ("clients", "city agencies", etc.))

Last night we were discussing copy changes over the phone.  Whenever she
tried to click on the "our sponsors" link on the left-hand nav bar she would
get an error message that read something like: "Javascript error, line 117,
document sponsors not an object"  She was looking at the pages in IE (but
couldn't tell me which version) on a PC.  I had looked at the pages on a PC
yesterday in both IE 5.5 and Netscape 4.7 and didn't encounter this problem.
I'm on a Mac now, and don't get that message in either IE 4.5 or Netscape
4.6.  (After rebooting, she also got the error message when trying to click
on the "our volunteers" button.)



--------------------- End of message text --------------------

The principal place of business of PricewaterhouseCoopers and its associate
partnerships is 1 Embankment Place, London WC2N 6NN where lists of the
partners' names are available for inspection. All partners in the associate
partnerships are authorised to conduct business as agents of, and all
contracts for services to clients are with, PricewaterhouseCoopers. The UK
firm of PricewaterhouseCoopers is authorised by the Institute of Chartered
Accountants in England and Wales to carry on investment business.
PricewaterhouseCoopers is a member of the world-wide
PricewaterhouseCoopers organisation.
----------------------------------------------------------------
The information transmitted is intended only for the person or entity to which
it is addressed and may contain confidential and/or privileged material.  Any
review, retransmission, dissemination or other use of, or taking of any action
in reliance upon, this information by persons or entities other than the
intended recipient is prohibited.   If you received this in error, please
contact the sender and delete the material from any computer.






More information about the thelist mailing list