Demo JQuery .show(), .hide() dan .toggle()
by Alexus fox
HTML
<button class="call">CALL</button>
<button class="text">TEXT</button>
<button class="chat">CHAT</button>
<div id="target">Suicde hotline</div>
CSS
body {
padding: 30px;
}
#target{
background: grey;
height: 460px;
padding: 35px;
}
#target{
background: blue;
height: 460px;
padding: 35px;
}
#target{
background: pink;
height: 460px;
padding: 35px;
}
.call {
font-size: 24px;
}
.text {
font-size: 24px;
}
.chat {
font-size: 24px;
}
JavaScript
$('.text').click(function() {
$('#target').toggle('slow');
});
$('.call').click(function() {
$('#target').toggle('slow');
});
$('.chat').click(function() {
$('#target').toggle('slow');
});