WPComplete

JQuery Events

Available Custom jQuery events:

wpc-button-completed
wpc-button-completed::post ID-Button Name
wpc-page-completed
wpc-page-completed::post ID
wpc-course-completed
wpc-course-completed::Course Name

Examples:

Want to trigger some javascript once the user completes a page?

jQuery(document).on('wpc-page-completed', function(e) {
// do something awesome!
});

Need something to happen when a specific page is completed? Use the post’s ID:

jQuery(document).on('wpc-page-completed::430', function(e) {
// do something awesome!
});

Want to celebrate when your students finish any of your courses?

jQuery(document).on('wpc-course-completed', function(e) {
// Trigger confetti falling or something else awesome!
});

Only want to celebrate when they finish a specific course?

jQuery(document).on('wpc-course-completed::Course Name', function(e) {
// do something awesome!
});

You can also use this for when buttons are completed. If you want to do it for ANY button, use:

jQuery(document).on('wpc-button-completed', function(e) {
// trigger custom javascript!
});

If you want to trigger when a SPECIFIC button is completed, use that button’s post ID and name:

jQuery(document).on('wpc-button-completed::430-Video-3', function(e) {
// trigger custom javascript!
});





Return to our Knowledge Base

© WPComplete. Built by your favourite nerds Zack Gilbert & Paul Jarvis.