Author Topic: Easy Spoiler - Open a spoiler by clicking on another image  (Read 3472 times)


  • Tadpole
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
    • Email
Easy Spoiler - Open a spoiler by clicking on another image
« on: October 12, 2012, 01:22:58 AM »
First of all, I want to congratulate you for this great plugin, very useful and easy to use.
Here's what I would do but for now I can not do it.
I'd like to be able to open a spoiler by clicking on an image in the page.
Let me explain: I have a group of spoilers (a spoiler for each country) and a map of the world, countries are divided by "image maps". When I click on the map of Germany, for example, I want to open the spoiler Germany.
To make it simpler, I wish I could put the action "show / hide" where I want on the page and not only in the table.
I hope you can help me.
Thank you very much.

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spoiler - Open a spoiler by clicking on another image
« Reply #1 on: October 13, 2012, 01:53:01 PM »
well you COULD do this.  There is a javascript show/hide method generated for each spoiler.  If you knew the name of the method (which is generated to be unique) you could invoke it.

You could then hide the show/hide button using the admin settings.

The actual call you would make is:
wpSpoilerToggle("id", true, "", "", "fast", false);

where id is the number you have to figure out.  Look at the page HTML and search for "wpSpoilerToggle" to locate the first argument:

Code: [Select]
<a href="" onclick="wpSpoilerToggle(&quot;[b]spoilerDiv3a408001[/b]&quot;,true,&quot;Show&quot;,&quot;Hide&quot;,&quot;fast&quot;,false); return false;" id="spoilerDiv3a408001_action" class="easySpoilerButton" value="Show" align="right" style="font-size:100%;color:#000000;background-color:#fcfcfc;background-image:none;border: 1px inset;border-style:solid;border-color:#cccccc; margin: 3px 0px 3px 5px; padding: 4px;">Show</a>