Ho già provato anche così:Originariamente inviato da whisher
Ciao
guarda se queste ti possono tornare utili
bei tempi in cui mi facevo tutto a maninaCodice PHP:
function getTarget(e){
var target = window.event ? window.event.srcElement : e ? e.target : null;
if (!target){return false;}
return target;
};
function cancelClick(e){
if (window.event){
window.event.cancelBubble = true;
window.event.returnValue = false;
return;
}
if (e){
e.stopPropagation();
e.preventDefault();
}
};
function addEvent(elm, evType, fn, useCapture){
if (elm.addEventListener){
elm.addEventListener(evType, fn, useCapture);
} else if (elm.attachEvent) {
elm.attachEvent('on' + evType, fn);
} else {
elm['on' + evType] = fn;
}
};
Esempio
addEvent(el,'click',func,false);
PS
la + breve e + cross browser è
areas[i].onClick = function(){
shapeMouseOver(idName);
}
ma bisogna vedere cosa e idName
se è l'id dell'elemento puoi fare this.id
areas[i].onClick = function(){
shapeMouseOver(idName);
}
ma con scarsi risultati. Ora però sto usando mootools, e grazie alla funzione addEvents pare che non ci siano problemi.![]()