Jump to content

Equivalent of [spoiler] in html


Distracted

Recommended Posts

OK, so I've got this blog on Wordpress, and I'm trying to use the equivalent of the hide parts of posts in the same way the spoiler-tag does here.

 

So basically, I want to do this

 

[spoiler=Click here for more]More

 

 

using HTML. I'm not sure if every HTML-code works on wordpress, anyone else have experience with wordpress that can help me?

Link to comment
Share on other sites

There isn't such a code in html.

 

You have to use dhtml (dynamic html) which draws on javascripts to create collapsing tables.

Plv6Dz6.jpg

Operation Gold Sparkles :: Chompy Kills ::  Full Profound :: Champions :: Barbarian Notes :: Champions Tackle Box :: MA Rewards

Dragonkin Journals :: Ports Stories :: Elder Chronicles :: Boss Slayer :: Penance King :: Kal'gerion Titles :: Gold Statue

Link to comment
Share on other sites

exxactly paw_claw. you can make a spoiler script with javascript, but their is not a tag for "spoiler"

 

you could use something like this:

    <script type="text/javascript">
function showSpoiler(obj)
   {
   var inner = obj.parentNode.getElementsByTagName("div")[0];
   if (inner.style.display == "none")
       inner.style.display = "";
   else
       inner.style.display = "none";
   }
   </script>

in the head

 

and this is the code to hide

<div class="spoiler">
   <input type="button" onclick="showSpoiler(this);" value="Show/Hide" />
   <div class="inner" style="display:none;">
   This is a spoiler!
   </div>

change "this is a spoiler!" to whatever you want. you cna change the value= to what you want the button to say.

 

change were it says

Proud Ubuntu User!

There are no stupid questions, just stupid people. -Scott Adams

A computer once beat me at chess, but it was no match for me at kick boxing.-Emo Phillips

My Blog!

TyrantElf.png

TyrantElf.png

Link to comment
Share on other sites

I'm willing to bet that there is a wordpress app that will allow you to use this sort of functionality. Especially you are going to be using the actual CMS to do the posting, not HTML.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.