Sziasztok.
nekem is lenne egy problémám amire eddig nem találtam megoldást:
Adott egy kép, melynek egy adott részére (area shape="poly")
onmouseover esetén képet váltok (FF-ből színes lesz a határolt rész) és ekkor szeretném ha ugyanazon határolt részre kattintva újabb kép-re (nagyított kép-re) váltana.
A problémám, hogy nem engedi ugyanazon területre a kattintást, mint amire az onmouseover hivatkozik.
Ki lehet ezt valahogy játszani?
a kód:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Changing Image Source in a Device Independent Manner</title>
<script type="text/javascript">
/* This function will change the image src of an image element.
* param imgId - the id of the image object to change
* param isOver - true when mouse is over or object has focus,
* false when mouse move out or focus is lost
*/
function updateImage(imgId, isOver) {
var theImage = document.getElementById(imgId);
if (theImage != null) { //could use a try/catch block for user agents supporting at least JavaScript 1.4
// These browsers support try/catch - NetScape 6, IE 5, Mozilla, Firefox
if (isOver) {
theImage.setAttribute("src","szurke_nelkul_1280.jpg");
}
else {
theImage.setAttribute("src","szurke2_nelkul_ff_1280.jpg");
}
}
}
</script>
</head>
<body bgcolor="#000000">
<table border="0">
<tr>
<td height="820"><div align="center"><IMG SRC="szurke2_nelkul_ff_1280.jpg" border="0" alt="Choose a Hood!" id="wai" usemap="#Map"></div></td>
</tr>
</table>
<map name="Map">
<area shape="poly" coords="619,42,543,49,.....................530,59,500,119,476,186,475," alt="Magic" onmouseover="updateImage('wai', true);" onfocus="updateImage('wai', true);" onmouseout="updateImage('wai',false);" onblur="updateImage('wai',false);">
<AREA
HREF="nagyitott.html" ALT="Click-Click!" TITLE="CONTRACTS"
SHAPE=RECT COORDS="1,1 1280,351">
</map>
</body>
</html>