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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Image map, tooltips modification

    Hi.

    I have an interactive house on my website with an image map that different areas link to pages when clicked on. A short title when mouse hovers over.

    I want to make this look better, better display of text when mouse hovers over, and textbox below image that gives a descrpition of the area selected.

    Does anyone have a simple way I could do this?

    I am using wordpress.

    Thanks, James

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,501
    Thanks
    3
    Thanked 500 Times in 487 Posts
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    <script type="text/javascript">
    /*<![CDATA[*/
    
    function text(id,txt){
     document.getElementById(id).value=txt||'';
    }
    /*]]>*/
    </script></head>
    
    <body>
       <img src="http://www.vicsjavascripts.org.uk/StdImages/WinterPalace.jpg" alt="WinterPalace" usemap="#ImageMap1" ismap="ismap" />
    <br />
     <map name="ImageMap1" id="map1" >
      <area shape="rect" alt="" coords="6,138,73,199"  onmouseover="text('txt','Area 0');"  onmouseout="text('txt');" />
      <area shape="rect" alt="" coords="85,80,173,129"  onmouseover="text('txt','Area 1');"  onmouseout="text('txt');" />
      <area shape="circle" alt="" coords="235,158,15"  onmouseover="text('txt','Area 2');"  onmouseout="text('txt');" />
      <area shape="poly" alt="" coords="220,147,220,147,203,145,178,158,160,180,185,187,216,190,220,147"  onmouseover="text('txt','Area 3');"  onmouseout="text('txt');" />
     </map>
    <input id="txt" />
    </body>
    
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    New to the CF scene
    Join Date
    May 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Vic.

    This is great.

    Can I change the size of the text box below? I wanted to put a detailed description in this box.

    Thanks, James

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,501
    Thanks
    3
    Thanked 500 Times in 487 Posts
    to pass html to a div

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    <script type="text/javascript">
    /*<![CDATA[*/
    
    function text(id,txt){
     var obj=document.getElementById(id);
     if (obj){
      obj[obj.nodeName.toUpperCase()=='INPUT'?'value':'innerHTML']=txt||'';
     }
    }
    /*]]>*/
    </script></head>
    
    <body>
       <img src="http://www.vicsjavascripts.org.uk/StdImages/WinterPalace.jpg" alt="WinterPalace" usemap="#ImageMap1" ismap="ismap" />
    <br />
     <map name="ImageMap1" id="map1" >
      <area shape="rect" alt="" coords="6,138,73,199"  onmouseover="text('txt','Area 0 ');"  onmouseout="text('txt');" />
      <area shape="rect" alt="" coords="85,80,173,129"  onmouseover="text('txt','Area 1');"  onmouseout="text('txt');" />
      <area shape="circle" alt="" coords="235,158,15"  onmouseover="text('txt','Area 2');"  onmouseout="text('txt');" />
      <area shape="poly" alt="" coords="220,147,220,147,203,145,178,158,160,180,185,187,216,190,220,147"  onmouseover="text('txt','Area 3');"  onmouseout="text('txt');" />
     </map>
    <div  id="txt"></div>
    </body>
    
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #5
    New to the CF scene
    Join Date
    May 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks again.

    This is what i ended up with. Interactive House

    Is there a way I could make the outline of each item have a yellow flashing outline when hovered over with the mouse?

    Thanks, James


  •  

    Tags for this Thread

    Posting Permissions

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