Re: JavaScript / CSS Wizards Please Help

"Bailey, Bruce":

> I am arguing with a vendor by proxy about keeping text scalable.  I need
> help since I know just enough JavaScript to get in trouble.

This is unfortunately all that anyone appears to know, and all to many in
positions of serious influence (Netscape sample authors, MS sample
authors, Dreamweaver code include authors - don't even know how little
they know.)

>  Anyone have an authoritative but readable and structured reference that
> they like? The  resources I have found do not lend themselves to
accessible
> at all.  I am look for something like what the WDG folks have done for
HTML.
> <http://www.htmlhelp.com/reference/html40/>

There's nothing remotely like that, that I've ever seen, David Flanagan's
new book (O'Reilly) appears to be pretty good from reviews I trust and
from looking in the example code, and example chapter (I've not seen it in
a shop, and won't buy it from online simply because O'Reilly can't even
write sensible ad copy for it on their own site.) even that though has
seem deep flaws in it, it's a non-trivial subject, there are 25+
javascript capable browsers all with different DOM, core and HTML
implementations and just about anything anyone writes I can give a
(realistic) scenario where it will break.

Unfortunately there's nothing like the WDG folks have put together, Danny
Goodmans chart (available online in a PDF part of his latest book) covers
the 3 main browsers pretty well, as a simple map of what is reported.

> The vendor is using a public domain menu which I could NOT get to use
> relative units.  A discussion and download links to this file
(fw_menu.js)
> can be found at URL:
>
<http://www.macromedia.com/support/fireworks/ts/documents/commented_js_fil
e.
> htm>

Okay, brief look:

Consider the FIND function:

function FIND(item) {
 // If we define the "all" attribute, use it (IE only)
 if (document.all) return(document.all[item]);
 // If we did not have the "all" attribute, try the getElementById method
 //  Both Netscape 6/Mozilla and IE support this, but only Mozilla will
make it
 //  this far.
 if (document.getElementById) return(document.getElementById(item));
 // We did not have either way of searching.
 return(false);
}

It mentions Mozilla, and IE, lets look at what might happen in other
browsers:

Opera has document.all[1] so it evaluates to true, so Opera will return
undefined from that function (despite it supporting DOM1 so gEBI would
return the correct element like Mozilla (and Opera should be able to run
the script.)

> 2)  My idea is to invoke the calls to "new menu(...)" using a calculated
> number.  Is there a JavaScript/DOM variable for determining the current
text
> size (in pixels)?

There's some code you can use to do it in some browsers
(http://jibbering.com/accessibility/tabcontrol2.html has it - well it does
width replace Width with Height throughout, or check Groups.Google for
usenet posts from me which has individual code.  I don't really know what
your problem is, all you seem to need to do, is specify the font-size as
"1em" rather than "12" (or whatever) then just remove the hardcoded "px"
from line 280 (it's the only "px;" in the document.)

> P.S.,  The site in question is accessible and 508 compliant, but we are
> trying for AAA.

I personally do not believe that code should be able to get you to AAA, it
will error, and you will get undefined behaviour in browsers even
including the 3 it knows about (Mozilla, IE, and NN4) let alone all the
very capable browsers it doesn't know about.

>  Whoever negotiated the contract is paying by the hour
> rather than the job -- so we are paying for the contractor's learning
curve.
>

[1] In its popular spoof IE mode.

Jim.

Received on Tuesday, 4 December 2001 18:28:15 UTC