...

View Full Version : Dynamic display.



kodjo
07-03-2002, 10:34 AM
I work on one tools of simulation of machine. For that purpose, I identify in a base of data ACCESS elements necessary for the configuration of my workshop of Manufacture. Every machine has a name, a type and coordinates (X, Y).
I display with the coordinates, an image representing the situation of the machine in The workshop. I would like to display next to every image the name of the machine.
Indeed on, I created functions which allow me to show dynamically the images What avoids typing everything.
By means of a buckle, I pass of a recording to the following one.
I have for idea to use the same coordinates to show the name of the machine but I am incapable to show them next to image.
Would you have an idea to resolve my problem?
Thank you.

This is my code:

<html>
<body>

<script Language="JavaScript">

// Open the DataBase
var cnn = new ActiveXObject("ADODB.Connection");
cnn.Open
(
"Provider=Microsoft.Jet.OLEDB.4.0;"
+ "Data Source=c:\\TableSimat.mdb;" // name of the base ACCESS
);


// display the image in comparison with the coordinates in base
function ecritImg(x,y,w,h)
{
var Lanc="<img src=\"PGFL.bmp\"; style=\"position:absolute; width="+w+"%; height="+h+"%; left="+x+"%; top="+y+"%;\">";
document.write(Lanc);
// document.write(rst(0)); // to display the machine's name
}

// create recordsets for the coordinates and the name of the machine
var rstX = cnn.Execute("select r_zone_pgf_cordX from T_ZONE");
var rstY = cnn.Execute("select r_zone_pgf_cordY from T_ZONE");
var rst = cnn.Execute("select r_zone_pgf_num from T_ZONE");

// identificate the variables x and y
var x = rstX(0);
var y = rstY(0);

// buckle to read the coordinates and the name of the machine
while (!rstX.EOF & !rstY.EOF & !rst.EOF)
{
ecritImg(x,y,4,5); // width=4 et height=5
rstX.MoveNext();
rstY.MoveNext();
rst.MoveNext();
};

cnn.Close();

</script>
</body>
</html>

ronaldb66
07-03-2002, 12:49 PM
Kodjo,

you could try enclosing both the image and its description in a DIV and position that, instead of just the image.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum