Olá! Muitas vezes, é necessário exibir certa informação apenas sob demanda do usuário, por exemplo, após o clique em um botão. Há diversas formas de fazê-lo. Aqui, apresento a forma mais simples e prática para executar o efeito, entendendo seu funcionamento.
Exemplo 1 Exemplo 2
New Dawn Fades Joy Division
Change of speed, a change of style
A change of scene, with no regrets
A chance to watch, admire the distance
Still occupied, though you forget
Different colours, different shades
Over each mistakes were made, I took the blame
Directionless, so plain to see
A loaded gun won't set you free, so you say
We'll share a drink and step outside
An angry voice and one who cried
We'll give you everything and more
The strain's too much, can't take much more
Oh, I've walked on water, run through fire
Can't seem to feel it anymore
It was me, waiting for me
Hoping for something more
Me, see me in this time
Hoping for something else
Close
Candidate Joy Division
Forced by the pressure, the territory's marked No longer the pleasure, oh, I've since lost the heart Corrupted from memory, no longer the power It's creeping up slowly, that last fatal hour Oh, I don't know what made me or what gave me the right To mess with your values and change wrong to right Please keep your distance, the trail leads to here There's blood on your fingers brought on by fear I campaigned for nothing, I worked hard for this I tried to get to you, you treat me like this It's just second nature, it's what we've been shown We're living by your rules, that's all that we know I tried to get to you I tried to get to you I tried to get to you Oh, how I tried to get to you Close
Veja como funciona:
Código (javascript):
function mostrar(id){
document.getElementById(id).style.display = 'block';
}
function fechar(id){
if(document.getElementById(id).style.display == 'block'){
document.getElementById(id).style.display = 'none';
}else{
document.getElementById(id).style.display = 'block';
}
}
Nenhum comentário:
Postar um comentário