Código Javascript:
Ver original
function jBox(title,content){ var jB = document.getElementById('jBox'); var JTitle = document.getElementById('jB-title'); var JContent = document.getElementById('jB-content'); if(jB.style.display == 'none') {jBoxOn()} else if(jB.style.display == 'block') {jBoxOff()} function jBoxOn(){ jB.style.display = 'block'; JTitle.innerHTML = title; Jcontent.innerHTML = content; } function jBoxOff(){ jB.style.display = 'none'; JTitle.innerHTML = title; Jcontent.innerHTML = content; } }
Código HTML:
<div id="jBox"> <a href="javascript:;" onclick="jBox('','')">Cerrar</a> <span id="jB-title">Titulo</span> <span id="jB-content">Contenido</span> </div>