New Spoiler

Only one spoiler per reply works - New Spoiler

Only one spoiler per reply works

by AzMandius » Tue Feb 24, 2015 10:22 am

Hi,
Are you aware of the fact that only one spoiler per reply works? If i add two spoilers per reply, with different text, upon clicking the "show" button always the first spoiler content opens.
Thanks.
User avatar
AzMandius
Registered User
Posts: 36
Joined: Thu Jun 13, 2013 11:58 pm
Location: Moldova
Contact:

Re: Only one spoiler per reply works

by SGMonkey » Wed Mar 04, 2015 12:00 am

I noticed this too. Doesn't work well at all.

You might want to try something like this.

Code: Select all

<div style="padding: 3px; background-color: #FFFFFF; border: 1px solid #d8d8d8; font-size: 1em;"><div style="text-transform: uppercase; border-bottom: 1px solid #CCCCCC; margin-bottom: 3px; font-size: 0.8em; font-weight: bold; display: block;"><span 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.innerHTML = '<b>Spoiler: </b><a href=\'#\' onClick=\'return false;\'>hide</a>'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = '<b>Spoiler: </b><a href=\'#\' onClick=\'return false;\'>show</a>'; }" /><b>Spoiler: </b><a href="#" onClick="return false;">show</a></span></div><div class="quotecontent"><div style="display: none;">{TEXT}</div></div></div>
User avatar
SGMonkey
Registered User
Posts: 61
Joined: Mon Mar 24, 2014 5:57 pm
Location: UK
Contact:

Re: Only one spoiler per reply works

by AzMandius » Wed Mar 04, 2015 10:31 am

Thanks,
That's something I'm using right now, i just really liked that button style spoiler :)
To bad it doesn't works 100% :(
Regards
User avatar
AzMandius
Registered User
Posts: 36
Joined: Thu Jun 13, 2013 11:58 pm
Location: Moldova
Contact:

Re: Only one spoiler per reply works

by Freddy. » Mon Apr 06, 2015 1:09 pm

You can easily fix this for current style.

Code: Select all

<div style="margin-bottom: 2px;">
    <b>Hidden text. </b>

    <input value="Show" type="button" style="margin: 0px; padding: 0px; width: 60px; font-size: 10px;"
           onclick="
                   if (this.parentNode.getElementsByTagName('div')[1].style.display != 'inline') {
                       this.parentNode.getElementsByTagName('div')[1].style.display = 'inline';
                       this.value = 'Hide';
                   } else {
                       this.parentNode.getElementsByTagName('div')[1].style.display = 'none';
                       this.value = 'Show';
                   }">

    <div style="border: 1px inset; padding: 6px; margin-top: 3px;">
        <div style="display: none;">{TEXT}</div>
    </div>
</div>


I personally would change the border to "1px solid #000", but that's more of custom preference.
Freddy.
Registered User
Posts: 1
Joined: Mon Apr 06, 2015 1:01 pm
Contact:

Re: Only one spoiler per reply works

by AzMandius » Tue Apr 07, 2015 10:23 am

Nice adjustment, thank you :)
User avatar
AzMandius
Registered User
Posts: 36
Joined: Thu Jun 13, 2013 11:58 pm
Location: Moldova
Contact:

Re: Only one spoiler per reply works

by almo2001 » Fri Sep 18, 2015 12:32 am

This works with version 3.1.6.
almo2001
Registered User
Posts: 19
Joined: Mon May 29, 2006 3:48 am

Re: Only one spoiler per reply works

by topaz1990 » Thu Jan 07, 2016 12:12 am

hmm is it possible to make smthng like that :


[spoiler]
spoiler 1
[spoiler]spoiler 1.1[/spoiler]
[spoiler]spoiler 1.2[/spoiler]
[/spoiler]

i need to put 1 spoiler into another, but it wonw work beacuse main spoiler is closing right afther first [/spoiler], but is should not close him but spoiler 1.1

anybody know how to do this ?
js allowed

if you have any solution pls share
topaz1990
Registered User
Posts: 4
Joined: Wed Dec 30, 2015 2:46 am
Contact: