I have a few click/hover events I want to attach to items in a list view, but when changing pages using the default ajax buttons (1, 2, etc) the events are not attached to the new items…
I’ve tried using afterAjaxUpdate in my index.php, but it only seems to update the items when they are loaded initially, and not when the page changes:
Well, I tried live and it works for fine the click functions, but hover seemed to have the same result, where it wouldn’t work after a new set of items got loaded.
Additionally I read that live is depreciated as of jQuery 1.7, and so I’ve been trying (where possible) to explore other alternatives.
As its own documentation states, use .on() instead.
As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().