[thelist] DHTML questions...

JTocher janice at discoverysystems.com
Thu Nov 15 07:46:47 CST 2001


Hello all...

Am dabbling in using DHTML to locate a box (created using CSS) on a map and
am having fits. Partially, because I don't understand how to use a function
to set variables and partially because Netscape is not acting the same as
Explorer. After spending last night studying up on functions and variables,
am still lost and hoping someone more knowledgeable can provide some
insight.

First question - how to use a function to set variables. I have the
following set up as a function -

function locateBox(top_loc,left_loc)
    {
    return top_loc;
    return left_loc;
    }

When clicking an image, I want to update the top_loc & left_loc variables
using:

onclick="locateBox(50,90)"

This should update a <div> style with the appropriate numbers and move my
box on the map using the following:

document.writeln("<div style='border: solid 2px yellow; position: absolute;
z-index: 100; top: " + top_loc + "px; left: " + left_loc + "px; width: 20px;
height: 20 px; visibility: visible '>&nbsp;</div>");

You can see my test code at the following:

http://averra.com/mstest/testing_4.htm

Note that I am using the document.writeln to display the variables.


Now, second question - even should I get this working, am I headed down the
wrong path??? Take a look at

http://averra.com/mstest/testing_3.htm

which is using javascript to create the <div> tag - works fine 'n dandy in
Explorer, but not in Netscape (v4.7) - why, oh why??? This works in Netscape
with standard html but now when generated with javascript.

ANY clues, insights, etc. would be most appreciated!

Janice






More information about the thelist mailing list