WordPress.org

Support

Support » Plugins and Hacks » Q and A Focus Plus FAQ » Suggestion: Dynamic behaviour

Suggestion: Dynamic behaviour

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ELsMystERy

    @elsmystery

    I will consider adding this to the next major update. Probably sometime in December.

    Plugin Author ELsMystERy

    @elsmystery

    You can do this by putting the FAQ shortcode in a div on the FAQ page and adding an expand/collapse link use jQuery to open and close the div to show, or hide the FAQ.

    Plugin Author ELsMystERy

    @elsmystery

    I hope you got this working. I am marking this topic as resolved.

    Well, I am using that, but is not working very well. When someone clicks a FAQ, it stops working. Any suggestions?

    // HTML
    < a id=”label” onclick=”changeDiv(‘close’,’open’);”>Open all</ a>
    <div id=”close” style=”display: block;”>[qafp]</div>
    <div id=”open” style=”display: none;”>[qafp collapsible=true]</div>

    // JS
    function changeDiv(id1,id2) {
    var e1 = document.getElementById(id1);
    var e2 = document.getElementById(id2);
    if (e1.style.display == ‘block’) {
    e1.style.display = ‘none’;
    e2.style.display = ‘block’;
    document.getElementById(‘label’).innerHTML = ‘Close All’;
    } else {
    e1.style.display = ‘block’;
    e2.style.display = ‘none’;
    document.getElementById(‘label’).innerHTML = ‘Open All’;
    }
    }

    Plugin Author ELsMystERy

    @elsmystery

    Hmmm.. I am really short on time at the moment, but I will look at this later and see if I can come up with something.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Suggestion: Dynamic behaviour’ is closed to new replies.
Skip to toolbar