WordPress.org

Ready to get started?Download WordPress

Forums

WP 1.5: Spoiler hack needed. (25 posts)

  1. XeroCool
    Member
    Posted 9 years ago #

    I need a spoiler for WP 1.5. Has any one made one?

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    I know what a spoiler for a car is, but for a blog ?

  3. BuffyVS
    Member
    Posted 9 years ago #

    podz... it allows you to write text that needs to behighlighted in order to view it.

    A lot of sites dedicated to tv shows have spoiler text.. (text goes to same color as background; generally shown as Spoiler Text:[XXXXXXXXXXXXXXXXXXXXXXXXX]
    with inbetween brackets not shown until highlighted

    And yeah, probably needed for those with fan/tv show blogs. I would actually like this myself for some things

  4. Mark (podz)
    Support Maven
    Posted 9 years ago #

    In that case, just create the right css class and use either a span or a div for that.

  5. BuffyVS
    Member
    Posted 9 years ago #

    I still wouldnt even know how to do that, but thanks.. will see if Lisa Explains has some tips on doing that

  6. NuclearMoose
    Member
    Posted 9 years ago #

    Add this to your style sheet:

    .spoiler {
    background-colour: white;
    colour: white;
    }

    Use this in your post:

    <span class="spoiler">This is spoiler text.</span>
    <div class="spoiler">This is a div with nothing but spoiler text.</div>

    That should work!

  7. Mark (podz)
    Support Maven
    Posted 9 years ago #

    In css:
    .spoiler {
    color: #000;
    }

    In an entry:
    <div class="spoiler">Hidden characters here I hope</div>

    It does work:
    http://www.tamba2.org.uk/T2/archives/2005/01/15/bits-and-bobs/

    and you might want to add 'display:inline;' to that if you are going to plant it inside paragraphs.

  8. Mark (podz)
    Support Maven
    Posted 9 years ago #

    NM :p

    :)

  9. NuclearMoose
    Member
    Posted 9 years ago #

    HA! Some of your own medicine for a change, Podzie! :P

  10. XeroCool
    Member
    Posted 9 years ago #

    Going to try now :P. Thanks.

  11. XeroCool
    Member
    Posted 9 years ago #

    Ok. But:

    I want it to show:

    Click here for spoiler!

    and when they click it, On the bottom, the spoiler will appear.

  12. zeeg
    Member
    Posted 9 years ago #

    Ok someone whos familiar with javascript, more so then me, finish this :)

    I have to leave or I would but it's giving me an error

    <style id="spoiler"><!--
    .spoiler {
    visibility: hidden;
    }
    --></style>
    <scrpt language="JavaScript" type="text/javascript"><!--
    function showSpoilers()
    {
    object = document.getElementById("spoiler");
    object.disabled = true;
    }
    --></script>
    <span onclick="showSpoilers();" onmouseover="this.style.cursor="hand";">Show Spoilers</span>
    Spoiler: <span class="spoiler">Spoiler would go here</span>

    Spoiler: <span class="spoiler">Spoiler2 would go here</span>

    --- Also seems i broke bbPress :)

  13. XeroCool
    Member
    Posted 9 years ago #

    Its giving you a error because you got a typo =P.

    <scrpt language="JavaScript" should be <script language="JavaScript".

    Where do I insert that code..

  14. zeeg
    Member
    Posted 9 years ago #

    oh if it works after that, you put the javascript and style info in the "Header Template" or whatever, then just put the <span onclick> on any page where you plan on using spoilers (or youc ould add it to some Post template im not sure how those work, so it adds it on every page), and then just <span class="spoiler"> where you want spoilers

  15. zeeg
    Member
    Posted 9 years ago #

    Ok well the bbPress bugs the code a bit but ya

    dcramer[at]gmail.com is my msn, or email, contact me and ill help ya set it up.

    If you email me include what version of wordpress, ill also send you updated code

  16. Kitten
    Member
    Posted 9 years ago #

    Actually, a pure CSS way to do this would be to have .spoiler class as above but to also add:

    .spoiler:hover
    {
    color: red;
    }

    Which would make the text red when the pointer is over the span.

  17. zeeg
    Member
    Posted 9 years ago #

    And the pure css way wont work in any browser unless its a link or a list :)

    (Unless they've added it to a browser It wont)

  18. Kitten
    Member
    Posted 9 years ago #

    CSS2 adds :hover support to any element

  19. zeeg
    Member
    Posted 9 years ago #

    Yes but I believe 90% of browsers do not support it

  20. zeeg
    Member
    Posted 9 years ago #

  21. idban
    Member
    Posted 9 years ago #

    i didnt use 1.5, i use 1.2 but please try it
    http://secandri.com/blog/2004/07/12/spoiler-tag-installation-howto/

  22. unruly
    Member
    Posted 9 years ago #

    zeeg, you mean the one browser that doesn't support it is MSIE?

    'cause every other graphical browser out there supports it.

  23. zeeg
    Member
    Posted 9 years ago #

    so if i add img:hover mozilla will support it? or td:hover

    last I heard, the only supported methods in moz were a, and li

  24. BuffyVS
    Member
    Posted 9 years ago #

    kitten- great suggestion! That will work, its just like having links change colors on hover, and it does work in the browers zeeg.

    Thnx Kitten

  25. idban
    Member
    Posted 9 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.