Simple Spoiler | andi setiawan's blog

This is a quick tutorial on creating a simple spoiler, just copy-paste the script into your html page, and voila.. there you go..

Example :

Spoiler for Pictures ::

andoid ePad keren

Android ePad

The code :

<div>
<div style="margin-bottom: 2px;">
<b>Spoiler</b> for <i>Pictures :</i>:
<input value="Show" style="width: 60px; font-size: 10px; margin: 0px; padding: 0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';        this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" type="button">
</div>
<div style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
<img src="http://www.wareground.com/images/400/dreambook_epad_7.jpg" alt="andoid ePad keren" />
<br />
<img src="http://image.made-in-china.com/2f0j00yBoEjlvIMMcC/EPad-7-0-Inch-Touch-Screen-Camera-Tablet-PC-MID.jpg" alt="Android ePad" />
</div>
</div>
</div>


Posted in programming, Tips n Trik |

1 thought on “Simple Spoiler

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: