1

I have been working with this jquery plugin to use its event on my code but I had no luck.

here is the list of events:

events.onStartQuiz (function) Default: empty; - a function to be executed once the quiz has started.

events.onCompleteQuiz (function) Default: empty; - a function to be executed the quiz has completed; the function will be passed two arguments in an object: options.questionCount, options.score

can someone help me to know how to use events on this plugin.

https://jsfiddle.net/pcvkqwut/

$(function () { 
    $('#slickQuiz').slickQuiz({
    });
});
Enzo
  • 198
  • 2
  • 11

1 Answers1

1

They are properties of the options object you need to pass to slickQuiz() when you instantiate it:

$(function() {
  $('#slickQuiz').slickQuiz({
    events: {
      onStartQuiz: function() {
        console.log('started');
      },
      onCompleteQuiz: function() {
        console.log('completed');
      }
    }
  });
});

Updated fiddle

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339