динамическое создание карты

Alexandre

PHPПенсионер
динамическое создание карты

у меня должна динамически создаться карта
PHP:
<map name="map" >
<area shape="rect" coords="52,72,83,107"  onmousemove="show(0)" onmouseout="hide()"> 
<area shape="rect" coords="162,18,194,50"  onmousemove="show(1)" onmouseout="hide()"> 
<area shape="rect" coords="273,70,305,102"  onmousemove="show(2)" onmouseout="hide()">
я написал следующий скрипт:
PHP:
// bx.by - массивы координат точек
function test(){
var ar;
for (i=0; i<3; i++) {
x=bx[i]+32;
y=by[i]+32;
str=bx[i]+","+by[i]+","+x+","+y;
 ar = document.createElement('area');
 ar.coords=str;
 ar.shape="rect";
 ar.event.onmousemove="show("+i+")" ;
 ar.event.onmouseout="hide()";
 map.appendChild( ar );
}}
что я не так сделал?
 

Alexandre

PHPПенсионер
карта не реагирует на события onmousemove onmouseout
при том что при статическом создании карты события обрабатываются
 

Alexandre

PHPПенсионер
попробовал так:
PHP:
for (i=0; i<3; i++) {
x=bx[i]+32;
y=by[i]+32;
str=bx[i]+","+by[i]+","+x+","+y;

ar =  document.createElement('area');
ar.setAttribute('coords',str);
ar.setAttribute('share','rect');
ar.setAttribute('onmousemove',"show("+i+")" );
ar.setAttribute('onmouseout', "hide()");
 map.appendChild( ar );
}
не помогает, хотя показывает что map имеет 3 чилда...
 
Сверху