Events for searching
-
Started using this plugin a couple of days ago and I like it so far. However, I can’t seem to find any events I can use.
What I need is an event for
– When the search is complete and suggestions are shown
– When the suggestion box dissappears, e.g. from mouseleave event
I tried onAjaxComplete() but it’s inaccurate, as the event is fired as soon as the AJAX search is complete – not when suggestions are shown.
I tried using MutationObserver on the suggestions box, but it hurts performance as the element is appended through JS and therefore I would have to make a MutationObserver on the whole body element to observe when the element is appended, which hurts performance.I tried with document.ready, but it still doesn’t let me target the element.
I could somewhat make it work with MutationObserver on the preloader icon – between the “x”, the search icon and the spinner, but it’s really wonky and I figured there must be a better way. I tried looking through the source code but to no avail. In the plugin documentation it doesn’t state anything about events either.
So, are there any specific events associated with this plugin, or perhaps you could point me in the right direction of what event I could use?
Thank you!
- The topic ‘Events for searching’ is closed to new replies.