Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Roll over on Map Images??????

  1. #1
    Join Date
    Feb 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Roll over on Map Images??????

    hi guys,

    i have problem in here, and dont know how to solve it. well, i've created a map image, (you can see it at: http://tintasii.moldovacrestina.net/something.html) but i would like to add to the link a RollOver, or something that would distinguish links from the rest of the image!

    Is there any way to make it?
    here is the code i used for the map

    Code:
    <img id="meciuri" src="media/ball-menu.jpg" usemap="#ball-menu">
    <map name="ball-menu">
    <area shape="rect" coords="265,475,365,525" href="index.htm" alt="cerc">	
    </map>
    Thank you guys for your help!

  2. #2
    Join Date
    Feb 2007
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I've tried playing around with it a bit. The only solution I can come up with is to eliminate the map entirely and use divs.

    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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Tintasii Menu</title>
    <style type="text/css">
    
    
    #meciuri a:hover {
    	background: red url(media/hover-meciuri.gif)
    	background-repeat: no-repeat;
    }
    
    #link1
    {
    	position: absolute;
    	top: 442px;
    	left: 257px;
    	width: 128px;
    	height: 128px;
    	background-image: url("rollover1.gif");
    	background-position: 1000px 32px;
    	background-repeat: no-repeat;
    }
    
    #bodybgmenu
    {
    	position: relative;
    }
    
    </style>
    
    </head>
    
    <body>
    
    <div id="bodybgmenu">
    
    <img id="meciuri" src="http://tintasii.moldovacrestina.net/media/ball-menu.jpg" usemap="#ball-menu">
    
    <a href="#">
    <div id="link1" onmouseover="this.style.backgroundPosition='7px 32px;'" onmouseout="this.style.backgroundPosition='1000px 32px;'"></div>
    </a>
    
    </div>
    
    </body>
    </html>
    Here's a working example:

    http://www.blake-foster.com/demo/something.html
    Last edited by Blake; 02-27-2007 at 03:56 PM. Reason: Fixed it so that it works right in Internet Exploder
    "Rock and roll ain't noise pollution." - AC/DC

    http://www.blake-foster.com

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by slava View Post
    hi guys,

    i have problem in here, and dont know how to solve it. well, i've created a map image, (you can see it at: http://tintasii.moldovacrestina.net/something.html) but i would like to add to the link a RollOver, or something that would distinguish links from the rest of the image!

    Is there any way to make it?
    here is the code i used for the map

    Code:
    <img id="meciuri" src="media/ball-menu.jpg" usemap="#ball-menu">
    <map name="ball-menu">
    <area shape="rect" coords="265,475,365,525" href="index.htm" alt="cerc">	
    </map>
    Thank you guys for your help!
    The simplest (and the only HTML) rollover is the title attribute, ex:

    Code:
    <img id="meciuri" src="media/ball-menu.jpg" usemap="#ball-menu">
    <map name="ball-menu">
    <area shape="rect" title="Home" coords="265,475,365,525" href="index.htm" alt="cerc">	
    </map>
    If you wish to use javascript, you can but a method must be devised to add the top coord + half the height of the shape to the top position of the image and the left coord + half the width of the shape to the left position of the image. If you do that (not too hard) then you can locate a javascript tool tip over the hot spot. If you want a rollover image, you can leave out the half dimensions.

    But, this being the HTML forum, I will leave the details to another time and/or place.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Feb 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re:

    Thanks for help,
    it sounds interesting with JavaScript,
    but what if i have more buttons like this on the same pic?

  5. #5
    Join Date
    Feb 2007
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Tintasii Menu</title>
    <style type="text/css">
    
    
    #meciuri a:hover {
    	background: red url(media/hover-meciuri.gif)
    	background-repeat: no-repeat;
    }
    
    #link1
    {
    	position: absolute;
    	top: 442px;
    	left: 257px;
    	width: 128px;
    	height: 128px;
    	background-image: url("rollover1.gif");
    	background-position: 1000px 32px;
    	background-repeat: no-repeat;
    }
    
    #link2
    {
    	position: absolute;
    	top: 410px;
    	left:455px;
    	width: 96px;
    	height: 128px;
    	background-image: url("rollover2.gif");
    	background-position: 1000px 24px;
    	background-repeat: no-repeat;
    }
    
    #bodybgmenu
    {
    	position: relative;
    }
    
    </style>
    
    </head>
    
    <body>
    
    <div id="bodybgmenu">
    
    <img id="meciuri" src="http://tintasii.moldovacrestina.net/media/ball-menu.jpg" usemap="#ball-menu">
    
    <a href="#">
    <div id="link1" onmouseover="this.style.backgroundPosition='7px 32px;'" onmouseout="this.style.backgroundPosition='1000px 32px;'"></div>
    </a>
    
    <a href="#">
    <div id="link2" onmouseover="this.style.backgroundPosition='13px 24px;'" onmouseout="this.style.backgroundPosition='1000px 24px;'"></div>
    </a>
    
    </div>
    
    </body>
    </html>
    I've updated the working example too.
    "Rock and roll ain't noise pollution." - AC/DC

    http://www.blake-foster.com

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by slava View Post
    what if i have more buttons like this on the same pic?
    Like what? I haven't even seen one button yet. If you mean more areas - then, each area may have its own title attribute.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Feb 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    #Blake

    Hey man, thanks, it works perfect and i like it, but it seams like the hole image is a link. is it posible to fix this?
    thanks

  8. #8
    Join Date
    Feb 2007
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Tintasii Menu</title>
    <style type="text/css">
    
    #meciuri
    {
    	position: absolute;
    	top: 0px;
    	left: 0px;
    }
    
    #link1
    {
    	position: absolute;
    	top: 442px;
    	left: 257px;
    	width: 128px;
    	height: 128px;
    	background-image: url("rollover1.gif");
    	background-position: 1000px 30px;
    	background-repeat: no-repeat;
    }
    
    #link2
    {
    	position: absolute;
    	top: 410px;
    	left:455px;
    	width: 96px;
    	height: 128px;
    	background-image: url("rollover2.gif");
    	background-position: 1000px 22px;
    	background-repeat: no-repeat;
    }
    
    #bodybgmenu
    {
    	position: relative;
    }
    
    </style>
    
    </head>
    
    <body>
    
    <div id="bodybgmenu">
    
    <img id="meciuri" src="http://tintasii.moldovacrestina.net/media/ball-menu.jpg"/>
    
    <a href="#">
    <div id="link1" onmouseover="this.style.backgroundPosition='5px 30px;'" onmouseout="this.style.backgroundPosition='1000px 30px;'"></div>
    </a>
    
    <a href="#">
    <div id="link2" onmouseover="this.style.backgroundPosition='11px 22px;'" onmouseout="this.style.backgroundPosition='1000px 22px;'"></div>
    </a>
    
    </div>
    
    </body>
    </html>
    "Rock and roll ain't noise pollution." - AC/DC

    http://www.blake-foster.com

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Blake View Post
    Doesn't work in Opera, throws errors in IE 7. OK in FF.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Feb 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    #jscheuer1

    ok, i'm still working on it, so i'll be adding more areas for the buttons, i just dont know which way is better, and if you could give an advise on this, that would be good.

    Thanks !

Bookmarks

Posting Permissions

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