★ Tutor : Text Show/Hide.
CLICK HERE TO READ SOMETHING SPECIAL.
I'm a barbie girl,
In a barbie woooorld,
Life in plastic,
So fantastic!
You can brush my hair,
And dress me everywherreeeee,
Imagination, Life is your creation !
Nak benda ni ? Jom ikut tuto saya :D
First , Dashboard > Design > Add Gadget > HTML/Javascript.
Paste code ni kat situ.
<script language="javascript">
function toggle() {
var ele = document.getElementById("toggleText");
var text = document.getElementById("displayText");
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "HERE";
}
else {
ele.style.display = "block";
text.innerHTML = "HERE";
}
}
</script>
CLICK <a id="displayText" href="javascript:toggle();">HERE</a> TO READ SOMETHING SPECIAL.
<div id="toggleText" style="display: none">
Isi lah apa-apa kat sini.
</div>
Kalau nak tukar yang
HERE warna
merah tu, pastikan semua ayat yang warna
merah sama.
Yang
CLICK tu ayat depan button show/hide text. Yang
TO READ SOMETHING SPECIAL. tu ayat belakang button show/hide text.
Isi lah apa-apa kat sini. tu contents show/hide button lepas ditekan.
Dah puas hati, Save terus. Jangan view kat Rich Text. Kalau tak, tak jadi.
Itu jee. Sila jangan complain tak jadi sebab saya buat jadi je. Pfft :P
Okbaii y'allz :)