Dashboard | +Follow

McJellyz Tutorialz.


★ Tutor : Text Show/Hide.

CLICK HERE TO READ SOMETHING SPECIAL.

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 :)



- Tutorial List
- Personal Blog

p/s ; This blog is for tutorials only.
p/s(ii) ; I'm more active on my personal blog.