Dentro de html tengo el siguiente código:
Cita:
La idea sería mostrar esa imagen pero donde yo quisiese y cuando yo quisiese. El cuando controló usando la siguiente función pero eso de donde me está costando lo suyo, alguién me podría ayudar? <img id="addInfGraphic" style="position:absolute;" class="addInfGraphic" src="../img/ok.png" alt="" />
En javascript:
Cita:
Como habeis visto al principio está oculto y luego con el 'block' lo hago visible y los alert-s uso para debuggear, pero no obtengo esos valores establecidos. function showGraphic(){
document.getElementById('addInfGraphic').style.top = 5;
document.getElementById('addInfGraphic').style.lef t = 4;
document.getElementById('addInfGraphic').style.dis play = 'block';
alert(document.getElementById('addInfGraphic').sty le.top);
alert(document.getElementById('addInfGraphic').sty le.left);
}
document.getElementById('addInfGraphic').style.top = 5;
document.getElementById('addInfGraphic').style.lef t = 4;
document.getElementById('addInfGraphic').style.dis play = 'block';
alert(document.getElementById('addInfGraphic').sty le.top);
alert(document.getElementById('addInfGraphic').sty le.left);
}
Gracias por vuestra paciencia y espero que me hayais entendido y resuelto el problema
