1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| function fnClick( obj, id_div){
// get element a afficher/masquer
var oDiv = document.getElementById( id_div);
// affiche la DIV
oDiv.style.display = 'block';
// sauvegarde des evenements
if( !obj.saveEvent){
obj.saveEvent = {
over : obj.onmouseover,
out : obj.onmouseout,
click : obj.onclick
}
}
// redefini les evenements
obj.onmouseout = function(){};
obj.onmouseover = function(){};
obj.onclick = function(){
// restaure les evenements
this.onmouseout = this.saveEvent.out;
this.onmouseover = this.saveEvent.over;
this.onclick = this.saveEvent.click;
// masque la DIV
oDiv.style.display = 'none';
};
} |