• I was looking to leverage css for the selected FAQ and close the non-selected FAQ while using the category slug short-code.

    The ‘stop()’ avoids UI bugs if some-one gets click-happy.

    Great Plug-in!

    faq-collapse.js

    jQuery(document).ready(function () {
    	jQuery(".faq_answer").hide();
    	jQuery(".faq_question").click(function () {
    		jQuery(".faq_answer").not(this).hide().parent().removeClass("currentFaq");
    		jQuery(this).stop().next(".faq_answer").slideToggle(200).parent().addClass("currentFaq");
    	});
    });

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Andrew Norcross

    (@norcross)

    Hadn’t even thought about folks getting click-happy. I’m getting ready to push out a pretty big update that includes jQuery ajax pagination, so I’ll test this along with it to make sure there are no conflicts. Thanks!

    Plugin Contributor Andrew Norcross

    (@norcross)

    Tested your code. It works well, however, it loses the ability to close an individual FAQ if you want to. I’m gonna play with it some more and see about including it in a future release. Thanks again!

    Thread Starter dwcouch

    (@dwcouch)

    Funny, I hadn’t thought about closing a FAQ once it opened.
    Thanks for the replay, I’m glad I could be of help!

    ~D

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘jQuery Mod – in case you were interested.’ is closed to new replies.