Created
May 16, 2019 08:05
-
-
Save koentjuh1/692810972f82793c1e47b776843455ad to your computer and use it in GitHub Desktop.
sf-pro-ajax-events.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//detects the start of an ajax request being made | |
$(document).on("sf:ajaxstart", ".searchandfilter", function(){ | |
console.log("ajax start"); | |
}); | |
//detects when the ajax request has finished and the content has been updated | |
// - add scripts that apply to your results here | |
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){ | |
console.log("ajax complete"); | |
//so load your lightbox or JS scripts here again | |
}); | |
//an event fired when S&F is initialised and S&F scripts have been loaded | |
$(document).on("sf:init", ".searchandfilter", function(){ | |
console.log("S&F JS initialised"); | |
}); | |
//depending on where you add your JS, sometimes its necessary to wrap the above events in a function (as is standard practice): | |
(function ( $ ) { | |
"use strict"; | |
$(document).on("sf:init", ".searchandfilter", function(){ | |
console.log("S&F JS initialised"); | |
}); | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment