Implementing DHTML in WebExpress


 Changebgcolor script: (for demo click here)

Currently in WebX:

To make this easier in WebX:

To add the changebgcolor script:


Name: src
Value: detect.js
Name: src
Value: changebgcolor.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>changebgcolor should create the 'detect.js' script tag and 'changebgcolor.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: changebgcolor ('test', 'red');
Name: onmouseout 
Value: changebgcolor ('test', 'white');

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

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


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

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

function changebgcolor (name, color)

//change background color of element -name-

{ if (unable) return;

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

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