PDA

View Full Version : Simple Spoiler Tag code


Amphoric
12-22-2010, 02:41 PM
hey everyone,

I was wondering if it would be possible to get a simple Spoiler code with a normal button for spoilers.

The one I'm currently using, seems to have a black border around my "spoiled text"

<div id="spoiler"><div><input type="button" value="Show Spoiler!" style="width:100px;font-size:12px;margin:10px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(' div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide Spoiler!'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show Spoiler!'; }" />
<div id="show" style="background-image:images/misc/spoilerimg.png; display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%">
{param}</div>
<div id="hide"></div></div></div>

I'd rather use a simple version if that is possible or find the thing that is causing my black lined border problem.

nvm i figured it out

please close

Videx
12-23-2010, 06:09 PM
For the benefit of future searchers, you should detail the problem and your solution.

Note also that different browsers treat spoiler code differently.