jakerella / jquerySimpleFAQ

Simple jQuery plugin for creating FAQ interfaces
12 stars 1 forks source link

jquerySimpleFAQ

Simple jQuery plugin for creating FAQ interfaces

Features

Basic Usage

With an HTML data source:

<ul id='faqs'>
  <li>
    <!-- Note that you MUST have the "question", "answer", and "tags" classes on these nodes -->
    <p class='question'>This is a question?</p>
    <div class='answer'>This is the answer.</div>
    <p class='tags'>tags, help, searching</p>
  </li>
  ...
</ul>
$('#faqs').simpleFAQ(); // Most simple form (all default options)

When using the 'data' option (JSON) and searching:

<div><input type='text' id='faqSearch' /></div>
<ul id='faqs'></ul>
$('#faqs').simpleFAQ({
  data: [
    {
      question: "This is a question?",
      answer: "This is the answer.",
      tags: "tags, help, searching" // OPTIONAL, useful for search scoring (and displaying if you wish)
    },
    ...
  ],
  allowSearch: true,
  searchNode: '#faqSearch'
});

See more examples at: http://jordankasper.com/jquery/faq/examples

Events

Event Example

$('#faqs').bind('searchEnd.simpleFAQ', function(jQEvent, results) {
  if (results.length < 1) {
    // do something when there are no results?
  }
});

Options

Search Options