1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Adding a spoiler to pages

Discussion in 'XenForo Questions and Support' started by Ferdinand, Nov 3, 2014.

  1. Ferdinand

    Ferdinand Active Member

    Hi is it possible to use xenforo code to add a spoiler to pages at the moment I'm using the code below however it's not ideal? Thanks in advance.
        <title>Year 1</title>
        <style type="text/css">
        font-family:"Trebuchet ms",arial;font-size:0.9em;
        border:1px solid #ddd;
    .spoiler .inner
        border:1px solid #eee;
        <script type="text/javascript">
    function showSpoiler(obj)
        var inner = obj.parentNode.getElementsByTagName("div")[0];
        if (inner.style.display == "none")
            inner.style.display = "";
            inner.style.display = "none";
    <div class="spoiler">
        <input type="button" onclick="showSpoiler(this);" value="Show/Hide" />
        <div class="inner" style="display:none;">
        This is a spoiler!
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    A js solution like you have is what I would do. You have the functionality you want. What do you want to change about it? Maybe some styling?

Share This Page