Implementing DHTML in WebExpress

 

 Changefgcolor script: (for demo click here)

Currently in WebX:

To make this easier in WebX:

To add the changefgcolor script:

Insert>Script>Extensions

Name: src
Value: detect.js
Name: src
Value: changefgcolor.js

Add the 'detect.js' script whenever you use a script which acts upon a named DIV element, or when changing width or height.

Import>Scripts>changefgcolor should create the 'detect.js' script tag and 'changefgcolor.js' script tag.

 

Create a DIV tag with an 'ID' set:
ID = "test"
Then create a paragraph of text inside the DIV which you'd like to 'highlight' when a link is clicked or passed over.
Create a link
Hit the 'Extensions' button in the link dialog
Name: onmouseover
Value: changefgcolor ('test', 'red');
Name: onmouseout 
Value: changefgcolor ('test', 'black');

Any DIV tags with ID's set should be recorded in a list which you can choose from later in the 'changefgcolor' dialog.

If you use 'onclick' you will have to set the link to 'javascript: void(0);'

 

Rules/Problems with the 'changefgcolor.js' script:

The DIV ID's cannot be set automatically... (or can they?) 

This does not work in Netscape

 
function changefgcolor (name, color)

//change foreground color of element -name-

{ if (unable) return;

if (DOM){eval (wholebit + fgcolorbit + ' ="' + color + '"'); return;}

eval (frontbit + name + endbit + fgcolorbit + ' = "' + color + '"');

}

>>