Somes problems with Layers and JavaScript

Discussion in 'Javascript' started by HD, Feb 20, 2004.

  1. HD

    HD Guest

    Hi,

    I've a picture in a Layer (div). I would like locate a second layer
    according as the location of the first layer.

    Like that anywhere the location of the first layer, the second is always on
    the same location over the first layer.

    I've a marriage photography and I want have a circle over the figure I want
    when I locate the mouse-cursor over a link (the name of the figure I want).

    I've experiment to do the script but it won't take the location of the first
    layer...

    (excuse my english...)

    <HEAD>
    <script language=javascript>
    var layer;
    var layerimg;
    var dx;
    var dy;
    function Init () {
    document.onmousemove=ie;
    }
    function FSee (name,dy,dx) {
    layer = document.getElementById(name).style;
    layerimg = document.getElementById("mariaj").style;
    layer.top = dy+layerimg.top+"px";
    layer.left = dx+layerimg.left+"px";
    layer.visibility = 'visible';
    }
    function FHide (name) {
    layer = document.getElementById(name).style;
    layer.visibility = 'hidden';
    }
    Init();
    </script>
    </HEAD>
    ..........
    and
    ..........
    <div id="circle" style="position:absolute; z-index:2; visibility:hidden;">
    <img src="circle.gif">
    </div>
    <MAP NAME="Mariage">
    <AREA SHAPE=RECT COORDS="399,267,455,483" HREF="#" ALT="Marcel Jules">
    <AREA SHAPE=RECT COORDS="339,287,386,491" HREF="#" ALT="Louise Estelle">
    <AREA SHAPE=RECT COORDS="468,272,522,481" HREF="#" ALT="Marie Lucie">
    <AREA SHAPE=RECT COORDS="529,277,581,485" HREF="#" ALT="Charles Jules">
    <AREA SHAPE=RECT COORDS="261,274,323,482" HREF="#" ALT="Élizée">
    <AREA SHAPE=RECT COORDS="193,285,258,485" HREF="#" ALT="Marie Julia
    Estelle">
    <AREA SHAPE=RECT COORDS="225,215,269,284" HREF="#" ALT="André Charles Lucien
    ">
    <AREA SHAPE=RECT COORDS="298,227,340,280" HREF="#" ALT="Régina Gabrielle">
    <AREA SHAPE=POLY COORDS="317,204,323,280" HREF="#" ALT="André">
    <AREA SHAPE=RECT COORDS="353,163,396,215" HREF="#" ALT="Marius">
    <AREA SHAPE=RECT COORDS="391,135,430,201" HREF="#" ALT="Lucille">
    <AREA SHAPE=RECT COORDS="431,218,476,297" HREF="#" ALT="Elise">
    </MAP>
    <a onmouseover="FSee('circle',30,100);" onmouseout="FHide('circle');">
    Marcel Jules </a>



    Thanks for your help.
    --
    @+
    HD
     
    HD, Feb 20, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan Brunia
    Replies:
    1
    Views:
    562
    Pronab Pal
    Feb 10, 2004
  2. kev

    Dynamic Layers and IE

    kev, Sep 17, 2003, in forum: HTML
    Replies:
    2
    Views:
    377
  3. Andrew Banks

    Layers and Forms

    Andrew Banks, Dec 23, 2003, in forum: HTML
    Replies:
    3
    Views:
    390
    Mark Parnell
    Dec 23, 2003
  4. tigozilla

    question on javascript layers in aspnet

    tigozilla, Dec 23, 2005, in forum: ASP General
    Replies:
    1
    Views:
    158
    Bob Barrows [MVP]
    Dec 23, 2005
  5. Eclectic
    Replies:
    7
    Views:
    91
    Richard Cornford
    Oct 10, 2004
Loading...

Share This Page