WordPress.org

Ready to get started?Download WordPress

Forums

Q and A Focus Plus FAQ
Suggestion: Dynamic behaviour (6 posts)

  1. transfeo
    Member
    Posted 4 months ago #

    Can I dynamicaly change the FAQ presentation / behaviour? I would like to have button at the page, so whe the user presses it changes
    [qafp collapsible=true] or [qa collapsible=true], showing or collapsing all faq at once.

    Thanks.

    http://wordpress.org/plugins/q-and-a-focus-plus-faq/

  2. ELsMystERy
    Member
    Plugin Author

    Posted 4 months ago #

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

  3. ELsMystERy
    Member
    Plugin Author

    Posted 3 months ago #

    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.

  4. ELsMystERy
    Member
    Plugin Author

    Posted 3 months ago #

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

  5. transfeo
    Member
    Posted 1 month ago #

    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';
    }
    }

  6. ELsMystERy
    Member
    Plugin Author

    Posted 1 month ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic