Change foreground/layer color on AREA mouseover??

Discussion in 'Javascript' started by spamforsteve@hotmail.com, Jan 6, 2006.

  1. Guest

    Hi, all! I have an imagemap of a floor of offices. I have various
    events and an onclick function working just fine, but I'd like to be
    able to change the color of the region being hovered over. Is there
    any way to do this? Presumably I could just read the coords of the
    region, create a floating layer dynamically, and change the color, no?
    Unfortunately, I can't manage to read the coords property, and I'm not
    entirely certain how to build the floating layer.

    Any suggestions? No, I don't want to use Flash for this... ;-)

    Thanks!
    Jack
    , Jan 6, 2006
    #1
    1. Advertising

  2. Jonas Raoni Guest

    escreveu:
    > Hi, all! I have an imagemap of a floor of offices. I have various
    > events and an onclick function working just fine, but I'd like to be
    > able to change the color of the region being hovered over.


    You should post a link to help people understanding what you've done =)

    Are you using those mapped anchors? If yes, I think you'll have to keep
    the origin point coords somewhere or parse the coords and shape
    properties... If this is build dinamically, you can parse once and
    store in your database... Then you'll just need to place an image with
    the hovering effect over the real image... But this image will "hide"
    the link haha, so you'll have to emulate the link onclick :)

    Sorry for not helping too much ;]


    --
    Jonas Raoni Soares Silva
    http://www.jsfromhell.com
    Jonas Raoni, Jan 6, 2006
    #2
    1. Advertising

  3. Danny Guest

    Try


    <div id="overlayer" style="position: absolute;display: none"> give
    this div some width/height and a tone of gray or whatever color you
    need as overlay</div>


    <area .... onmouseover="YOURFUNCTION(this,'block')"
    onmouseout="YOURFUNCTION(this,'none')">


    function YOURFUNCTION(el,sView) {
    myoverlayer=document.getElemetnById('overlayer');
    myoverlayer.style.left=el.offsetLeft;
    myoverlayer.style.top=el.offsetTop;
    myoverlayer.style.display=sView;
    }

    Danny
    Danny, Jan 8, 2006
    #3
    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. Ahmad Hassan

    Changing foreground color on console

    Ahmad Hassan, Nov 6, 2003, in forum: C++
    Replies:
    4
    Views:
    855
    =?iso-8859-1?Q?Juli=E1n?= Albo
    Nov 11, 2003
  2. Dhananjay
    Replies:
    1
    Views:
    1,097
    sloan
    Dec 18, 2006
  3. slinky

    mouseover to change button color

    slinky, Jul 13, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,837
    nahid
    Jul 13, 2007
  4. Replies:
    3
    Views:
    85
  5. Amy
    Replies:
    2
    Views:
    249
Loading...

Share This Page