WordPress.org

Ready to get started?Download WordPress

Forums

FAQ Manager
[resolved] Add class to indicate "expanded" on faq question (5 posts)

  1. ijacobs
    Member
    Posted 3 years ago #

    Hi again,

    I would like to style faq questions that have been 'expanded' differently than those that are 'collapsed.' Currently you are changing display to "block" upon expansion. It would also be helpful to add a class value at the level of the single_faq to indicate that it is currently open. That will allow me, for instance, to use "open" and "collapsed" icons at the start of the questions.

    Thus: <div class="single_faq open"> or something similar when in the expanded state. Thanks!

    Another note: to make the FAQ questions keyboard navigable, I am doing this in the code of faq-manager (1.11) on line 78:

    $displayfaq .= '<'.$faq_htype.' id="'.$faq_slug.'" c\
    lass="faq_question'.$jquery_add.'">'.get_the_title().'</'.$faq_htype\
    .'>';

    That may not be the best way to make the code keyboard navigable in HTML5, but I've not had time to research a better way.

    Ian

  2. Andrew Norcross
    Member
    Plugin Author

    Posted 3 years ago #

    I'm still doing some digging into the best way to handle keyboard navigation. The display:block gets added automatically by the jQuery expand function. I'm not nearly as proficient in jQuery / javascript as I am with PHP, but I'll see if there's a way to include a class to indicate that it's indeed expanded.

  3. adam533
    Member
    Posted 2 years ago #

    Would also really like to see someway to show the question as being expanded. Client wants to show a different icon next to the question based on if the answer is showing or not.

    Great plugin, appreciate the support you provide. Also, looking forward to seeing you speak this Sunday at WordCamp Boston :)

  4. Andrew Norcross
    Member
    Plugin Author

    Posted 2 years ago #

    I'm still working on this. I've got a working model that I can attach to either the H tag or the text within, but not the outside single_faq, since all the jQuery functionality is contained within that block and not outside of it.

  5. Andy Leppard
    Member
    Posted 2 years ago #

    Any update on getting the class added to the expanded question?

    It could be anywhere, so long as it can be targeted with css. Lovely plugin BTW.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic