JavaScript events

You have the opportunity to listen to FiboSearch JS events and make the most of them.

The full list of FiboSearch JS events
fibosearch/open
After displaying search results
fibosearch/close
After closing auto suggestions
fibosearch/show-pre-suggestionsAfter the search history is displayed (the search bar is on focus, but customers haven’t yet typed their query
fibosearch/show-suggestions
After displaying or refreshing search results
fibosearch/no-results
If the query gives no results
fibosearch/show-details-panel
After opening the Details Panel
fibosearch/show-mobile-overlay
After the mobile mode is opened
fibosearch/hide-mobile-overlay
After the mobile mode is closed

Using FiboSearch JS events

You can listen to FiboSearch JS events:

  • using jQuery:
jQuery( document ).on( 'fibosearch/open', () => {
    // do your stuff here
} );
  • using “plain JS”:
document.addEventListener('fibosearch/no-results', (e) => {
    // do your stuff here
});