• hrf-script.js

    
    jQuery(function($){
       $(document).ready(function(){
          
          $('.hrf-title').click(function(){
             var $this = $(this)
                 ,$parent = $this.parent()
                 , my_content_id = $this.attr('data-content-id')
             ;
    
             $parent.find('#' + my_content_id).slideToggle();
             $this.toggleClass(function(){
                if ($(this).is('.close-faq')) {
                   return 'open-faq';
                } else {
                   return 'close-faq';
                }
             });
          }); //.hrf-title click
       });
    });
    
Viewing 1 replies (of 1 total)
  • Came here to post a similar request. It would be nice if the plugin appended the category onto the ID. If a FAQ is posted under multiple categories as desired, it’s currently failing to open the second category due to redundant ID’s. I did this in the plugin quite easily using the category slug already available and it fixed the issue.

    Also the option to close all other FAQ if you open a new one would be a simple option/enhancement.

    • This reply was modified 6 years, 9 months ago by designerwood.
    • This reply was modified 6 years, 9 months ago by designerwood.
    • This reply was modified 6 years, 9 months ago by designerwood.
Viewing 1 replies (of 1 total)
  • The topic ‘More same FAQs at one page – JS improvement’ is closed to new replies.