I recommend using jQuery, it makes understanding easier and you write less and do more.
I made a quick and simple code based on what you gave me:
HTML
<div class='conteudo-oculto'>
<div>Conteudo da sua mensagem</div>
<span style='display:none'>Mensagem oculta</span>
</div>
CSS
.conteudo-oculto span { display none; }
.blue { background-color: blue !important }
.conteudo-oculto { display: block; width: 200px; height:200px; background-color: red; padding:15px; border-radius:200px; line-height:200px; text-align:center; cursor:pointer }
Javascript
$( function (){
$(".conteudo-oculto").click( function(){
$(".conteudo-oculto div, .conteudo-oculto span").toggle();
if( !$(".conteudo-oculto").hasClass('blue') )
$(".conteudo-oculto").addClass('blue');
else
$(".conteudo-oculto").removeClass('blue');
});
});
Jsfiddle
Version 2
See if this is it (the HTML is the same):
CSS
.conteudo-oculto span { display none; }
.blue { background-color: blue !important }
.conteudo-oculto { display: block; width: 100px; padding-top:15px; height:100px; background-color: red; padding:15px; border-radius:100px; text-align:center; cursor:pointer }
Javascript
$( function (){
$(".conteudo-oculto").click( function(){
$(".conteudo-oculto div, .conteudo-oculto span").toggle();
if( !$(".conteudo-oculto").hasClass('blue') ){
$(".conteudo-oculto").animate({
height:'200px',
width:'200px',
'border-radius': '200px'
},1000);
$(".conteudo-oculto").addClass('blue');
}
else {
$(".conteudo-oculto").animate({
height:'100px',
width:'100px',
'border-radius': '100px'
},1000);
$(".conteudo-oculto").removeClass('blue');
}
});
});
Jsfiddle
Are you using some JS framework or do you want to do it with pure javascript ?
– fbadaro
pure javascript, @fbadaro, tipow, I have a "+" when clicking appears a background with info..
– Furlan