PDA

View Full Version : Spoiler tag for nsfw images


punchbowl
12-11-2007, 11:38 AM
that ensures the image isn't loaded until the button is clicked.

At present I use:

<div style="margin:5px 20px 20px 20px">
<div class="smallfont" style="margin-bottom:2px"><b>Spoiler:</b> <input type="button" value="View" style="width:80px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(' div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'View '; }"></div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
{param}
</div>
</div>

but this only hides the image/text meaning people at work could have nsfw pics showing up in their work cache despite having never actually seen the image.

So is it possibly to load the image thru js/ajax only AFTER the button is clicked?

Thanks in advance