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