This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: compatibility problems with javascript

Home Forums Product Support Forums Ajax Search Pro for WordPress Support compatibility problems with javascript Reply To: compatibility problems with javascript

#18685
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

The issue is, that the ajax results are considered as dynamically generated/inserted elements on the DOM node tree. Your code however will only work with items, that are present at the page load. You need a dynamic event binding function.

To correctly attach a handler, you need to use the jQuery.fn.on(..) function. In your case, something like this:

If I may recommend an alternative solution. Changing colors is much simpler by using custom CSS. In your case:

[html].asp_r .overlap:hover {
background-color: red;
}[/html]

That is much simpler in my opinion 🙂