Did you know that Doofinder can handle JavaScripts Events? This can help you to perform tailored behaviour with the Doofinder layer.
Here is the list of the different events the layer can handle:
document.addEventListener("doofinder.layer.load", () => {
console.log("Layer Loaded")
})
- The layer is loaded and ready when the websocket is connected, usually when clicking on the CSS selector that triggers the layer.
document.addEventListener("doofinder.layer.update", () => {
console.log("Layer Updated")
})
- The layer is updated, when performing a search, applying a filter, scrolling through the results
document.addEventListener("doofinder.carousel.load", () => {
console.log("Carousel Loaded")
})
- The carousel within the Doofinder layer, initial results or no results, has been loaded.