Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Paris
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamic display.

    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>
    Last edited by kodjo; 07-03-2002 at 10:22 AM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Kodjo,

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •