HighDots Forums  

zoom area sensibile jpeg

Javascript (Italian) Il linguaggio JavaScript (it.comp.lang.javascript)


Discuss zoom area sensibile jpeg in the Javascript (Italian) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cor_Pie\(\)
 
Posts: n/a

Default zoom area sensibile jpeg - 02-04-2004 , 10:13 AM






Ho una jpeg mappata ad aree sensibili con le coordinate riportate di
seguito:

<img src="../IMAGES/parco_museo.jpeg" width="924" height="641" border="0"
usemap="#Map">
<map name="Map">
<area shape="rect" coords="-1,-1,113,23" href="general_info.html">
<area shape="rect" coords="119,-1,233,22" href="chi_siamo.html">
<area shape="rect" coords="352,1,466,22" href="artisti.html">
<area shape="rect" coords="469,1,582,23" href="education.html">
<area shape="rect" coords="588,2,701,23" href="store.html">
</map>


vorrei poter visualizzare un'area di testo sulla stessa pagina del browser,
all'evento onMouseOver su una certa area sensibile di una mappa, come accade
per un link.Una cosa simile a quello che segue:

<area shape="rect" coords="-1,-1,113,23" onMouseOver="mostraTesto()"
href="general_info.html">

il problema è che non so come definire la funzione javascript mostraTesto().
Potete aiutarmi






Reply With Quote
  #2  
Old   
Andrea
 
Posts: n/a

Default Re: zoom area sensibile jpeg - 02-04-2004 , 10:21 AM






Quote:
Ho una jpeg mappata ad aree sensibili con le coordinate riportate di
seguito:

img src="../IMAGES/parco_museo.jpeg" width="924" height="641" border="0"
usemap="#Map"
map name="Map"
area shape="rect" coords="-1,-1,113,23" href="general_info.html"
area shape="rect" coords="119,-1,233,22" href="chi_siamo.html"
area shape="rect" coords="352,1,466,22" href="artisti.html"
area shape="rect" coords="469,1,582,23" href="education.html"
area shape="rect" coords="588,2,701,23" href="store.html"
/map


vorrei poter visualizzare un'area di testo sulla stessa pagina del
browser,
all'evento onMouseOver su una certa area sensibile di una mappa, come
accade
per un link.Una cosa simile a quello che segue:

area shape="rect" coords="-1,-1,113,23" onMouseOver="mostraTesto()"
href="general_info.html"

il problema è che non so come definire la funzione javascript
mostraTesto().
Potete aiutarmi
Nella pagina html crei un DIV invisibile con posizionamento assoluto che
contiene il testo da mostrare, una cosa del tipo:

<DIV ID="DivTesto" style="display: none; position: absolute">Questo è il
testo</DIV>

Quindi in uno SCRIPT crei le funzioni:

function mostraTesto(e) {
objDiv=document.getElementById('DivTesto');
objDiv.style.top=e.pageY;
objDiv.style.left=e.pageX;
objDiv.style.display='';
}

function nascondiTesto(e) {
objDiv=document.getElementById('DivTesto');
objDiv.style.display='none';
}

Ed infine modifichi la riga di codice che hai postato in questo modo:

<area shape="rect" coords="-1,-1,113,23" onMouseOver="mostraTesto(event);"
onMouseOut="nascondiTesto(event);" href="general_info.html">


Spero che funzioni perchè l'ho buttato giù "d'istinto", senza testarlo... ma
l'idea di fondo dovrebbe essere valida.

Ciao.
Andrea




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.