Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/01/2015, 12:54
pips
 
Fecha de Ingreso: octubre-2011
Mensajes: 104
Antigüedad: 12 años, 6 meses
Puntos: 1
Problemas esconder/mostrar

Hola a todos estoy con un hide/show en JS pero no funciona del todo bien.
Muestra los resultados pero una vez se muestran no se esconde

Código PHP:
<script>
OCULTO='none'; 
VISIBLE='block'; 

function mostrar(blo) { 
document.getElementById(blo).style.display=VISIBLE; 
document.getElementById('ver_off').style.display=VISIBLE; 
document.getElementById('ver_on').style.display=OCULTO; 

function ocultar(blo) { 
document.getElementById(blo).style.display=OCULTO; 
document.getElementById('ver_off').style.display=OCULTO; 
document.getElementById('ver_on').style.display=VISIBLE; 
}

</script>


<?php 
    
    
echo "<div id='ver_off' style='display: none;'><a onclick=ocultar('div{$group}') href='#'><span><b>{$title}</b></span></a></div>"
    
    echo 
"<div id='ver_on' style='display: block;'><a onclick=mostrar('div{$group}') href='#'><span><b>{$title}</b></span></a></div>";
    
   
   
    echo 
"<div id='div{$group}' style='display: none;'>";
?>
Alguna ayuda?
Gracias por adelantado,un saludo