473,327 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

changing div styles in image maps

hi all,
this is an intresting thing ,

i have a simple image map (with world map image),

in which i have diffrent regions specified ,also i have mentioned the
region names next to the map image
so now the functionality i want is :-

whenever the user hovers on the region (lets say :europe) the text
(europe) next to the image should change to bold & also the color
should change .

in the same way i have to change many dives for diffent regions

any help how i can change the classes for those dives after user
hovers on it ..? ,

thanks in advance,

Prashant.

Feb 28 '07 #1
4 1825
ASM
pr*********@gmail.com a écrit :
whenever the user hovers on the region (lets say :europe) the text
(europe) next to the image should change to bold & also the color
should change .

in the same way i have to change many dives for diffent regions

function boldIt(what) {
what = document.getElementById(what).style;
what.fontWeight = what.fontWeight=''? 'bold' : '';
}

<map ...
<area onmouseover="boldIt('div1');" onmouseout="boldIt('div1');" ...

<dt id="div1">Europe</dt>
and if you prefer class :

function boldIt(what) {
what = document.getElementById(what);
what.className = what.className=''? 'highlight' : '';
}
Idea :
------

CSS :
=====
#myMap { border:1px solid black; padding: 8px }
#myMap img { float: left; width: 200px; }
#myMap dl { position:relative; margin-left: 210px }
#myMap dt { color: blue }
#myMap dt.highligth { font-weight: bold; color: red }
#myMap dd { visibility: hidden }
#myMap dd.highligth { visibily: visible }

JS :
====
function higtLight(what) {
var D = document.getElementById('text_'+what);
var L = document.getElementById('legend_'+what);
D.className = D.className=''? 'highlight' : '';
L.className = L.className=''? 'highlight' : '';
}

HTML :
======
<div id="myMap">
<img usemap="#wrldMap"
src="world.jpg" alt"World Map" title"Oveflow me" />
<dl>
<dt id="legend_eur'>Europe</dt>
<dd id="text_eur'>Somewhere in North side</dd>
<dt id="legend_asi'>Asia</dt>
<dd id="text_asi'>Somewhere in South side</dd>
</dl>
<map name="wrldMap>
<AREA HREF="europe.htm" ... blah ...
onmouseover="higtLight('eur');"
onmouseout="higtLight('eur');>
<AREA HREF="asia.htm"... blah ...
onmouseover="higtLight('asi');"
onmouseout="higtLight('asi');>
</map>
</div>

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Feb 28 '07 #2
hey tahnks for your reply ,
u guys are relly helpful for beginers like me...

but the thing dosent work in my case i have tried a simple one ...
<html>
<head>
<script type="text/javascript">

function boldIt(what) {
what = document.getElementById(what).style;
what.fontWeight = what.fontWeight=''? 'bold' : '';
}
</script>
</head>
<body>
<img scr="wrld_map.jpg" type="image/jpg" usemap="#wrldMap">
<map name="wrldMap"
<area href="#" shape="poly" coords="........"
onmouseover="boldIt('div1');" onmouseout="boldIt('div1');">
</map>
<div id="div1">Europe</div>
</body>
</html>

do i need to add some more stuff ....?? or i am getting wrong
somwhere ...??
thanks,

Feb 28 '07 #3
ASM
pr*********@gmail.com a écrit :
hey tahnks for your reply ,
Please left some trace of post you're answering.
u guys are relly helpful for beginers like me...

but the thing dosent work in my case i have tried a simple one ...
<html>
<head>
<script type="text/javascript">
/* *** Ooops ! little error ! **** */

function boldIt(what) {
what = document.getElementById(what).style;
what.fontWeight = what.fontWeight==''? 'bold' : '';
}
</script>
</head>
<body>
<img scr="wrld_map.jpg" type="image/jpg" usemap="#wrldMap">
<map name="wrldMap"
<area href="#" shape="poly" coords="........"
with real coords it would be better
onmouseover="boldIt('div1');" onmouseout="boldIt('div1');">
</map>
<div id="div1">Europe</div>
</body>
</html>

do i need to add some more stuff ....?? or i am getting wrong
somwhere ...??
Not seems so.

And if you try the "idea"
correct it same way as above (two '=' insteed one '=' in condition)

function higtLight(what) {
var D = document.getElementById('text_'+what);
var L = document.getElementById('legend_'+what);
D.className = D.className==''? 'highlight' : '';
L.className = L.className==''? 'highlight' : '';
}
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Feb 28 '07 #4
On Feb 28, 11:15 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
prash.ma...@gmail.com a écrit :
hey tahnks for your reply ,

Please left some trace of post you're answering.
u guys are relly helpful for beginers like me...
but the thing dosent work in my case i have tried a simple one ...
<html>
<head>
<script type="text/javascript">

/* *** Ooops ! little error ! **** */

function boldIt(what) {
what = document.getElementById(what).style;
what.fontWeight = what.fontWeight==''? 'bold' : '';

}
</script>
</head>
<body>
<img scr="wrld_map.jpg" type="image/jpg" usemap="#wrldMap">
<map name="wrldMap"
<area href="#" shape="poly" coords="........"

with real coords it would be better
onmouseover="boldIt('div1');" onmouseout="boldIt('div1');">
</map>
<div id="div1">Europe</div>
</body>
</html>
do i need to add some more stuff ....?? or i am getting wrong
somwhere ...??

Not seems so.

And if you try the "idea"
correct it same way as above (two '=' insteed one '=' in condition)

function higtLight(what) {
var D = document.getElementById('text_'+what);
var L = document.getElementById('legend_'+what);
D.className = D.className==''? 'highlight' : '';
L.className = L.className==''? 'highlight' : '';

}

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
cool the problem is solved....
thanks once again.....

Mar 9 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stanimir Stamenkov | last post by:
I have this kind of construct: http://www.geocities.com/stanio/temp/usemap01.html (an IMG element using MAP described with AREA elements) I'm trying to make it more accessible and currently...
3
by: Geoff Soper | last post by:
I'm trying to dynamically change the cursor of a couple of maps over an image. Basically the image is in an online photo system where there is a rotate mode. In this mode clicking on the left or...
7
by: codeslayer | last post by:
Greetings to everyone in ‘forum-land': I have a problem that has plaguing me to no end. It is a CSS-related question, and I have not seen this question posted anywhere in forums or through...
14
by: Michael Satterwhite | last post by:
On my page, I'm positioning text on top of a graphic. I'm using the following code on my page: <img src="images/plainTop.gif" border="0" alt="" /> <div style="position: absolute; top:98px;...
12
by: Major Man | last post by:
Hi, I have this .jpg picture that's 700 x 200. What I wanna do is display it on a 300 x 200 window, and have it scroll left and right, back and forth. Can anyone help this newbie? TIA
4
by: Jim Land | last post by:
I've got an image and an image map, and they work fine together. See it here: http://www.jim-land.com/testing/MapPage01.htm But the image map has way too many points (vertices) in its 87...
0
by: Kevin Vaughn | last post by:
Is it possible to use image maps to divide up a picture acting as an image button? I have created a map of a building, and now I want to have some sort of pop-up messages when certain parts of...
7
by: petethebloke | last post by:
Can anyone help? I have a client who has made a "dynamic interactive map" of our city using Dreamweaver. Each map file has hotspots that pop-up a div with a little image when the mouse goes over...
6
by: David Stone | last post by:
I have a simple question about the alt content of area elements within an image map: is it redundant to include phrases such as "link to..." or "jump to..."? My initial thought is 'yes', since...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.