Click here to get back home

Coding javascript and css reliant UI elements

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Coding javascript and css reliant UI elements Spartanicus 10-13-2005
Get Chitika Premium
Posted by Spartanicus on October 13, 2005, 10:22 am
Please log in for more thread options


I'm pondering what the various drawbacks are of the methods to code UI
elements who's function relies on javascript and css.

Currently on http://www.pan-europe.utvinternet.ie/ I use styled <a>
elements to display two UI elements that via javascript select alternate
stylesheets that enable or disable the left utilities panel and/or the
navbar. (both are there for the convenience of desktop users, they are
not essential, likely to be a nuisance on narrow viewports or in aural
rendering)

Because these UI elements are useless when either javascript or css is
disabled I use js document.write for js off situations, css background
images for css off situations, css generated content or content wrapped
in a IE conditional comment for css2 aural renderers or IE based aural
renderers (content is positioned off screen).

The current method only displays small coloured boxes in images off
situations, but I'm ok with that.

I'm mainly pondering on the use of styled <button> elements instead of
styled links. Are there objections to using a form element like <button>
in a non form context?

Afaics a possible benefit of using <button> elements is that Opera has
separate keyboard controls for link and form elements, this potentially
allows a user quicker access to the UI controls, there is one (1 field +
1 button) search form on all pages and typically a lot more links to
step through.

The drawback I currently see is that the button element renders in css
off situations, whereas styled links disappear.

Currently I use href="javascript:void(function())" to activate the js
function, this causes the links to be included in the keyboard
navigation step sequence, if I use onclick then it (understandably)
doesn't in some browsers (IE and/or Mozilla IIRC). The drawback of using
href="javascript:void(function())" is that Opera displays that in it's
tooltip box, this I mainly consider an Opera quirk but I'd prefer to
avoid it if I could do so without causing other problems.

Any considerations I've missed?

--
Spartanicus

Similar ThreadsPosted
HTML Coding Guidelines May 21, 2005, 8:01 pm
Checking out the correctness of a site's coding October 23, 2004, 10:52 am
Chinese Characters in html (coding on a Mac OS X) February 13, 2006, 10:48 pm
Massive HTML coding errors April 13, 2006, 8:16 pm
Looking for platinum colour code for RGB coding November 11, 2007, 10:36 am
Multiple coding systems, and filesystems June 3, 2008, 5:08 pm
CSS for All Elements (Bullets February 22, 2005, 12:17 pm
CSS gap between inline elements February 7, 2008, 3:03 am
Form and nested elements November 10, 2004, 11:57 am
Visibility of form elements December 3, 2004, 8:01 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap