jQuery effects don't work on elements added by AJAX

jQuery effects don't work on elements added by AJAX

Hi there,

I am having problems with slideUp/slideDown effects on elements that I add to page with a AJAX callback. slideUp/Down works on elements that are present on the page load, but doesn't work on all elements added later with AJAX.

  1. <div id="lib-items">
  2.     <div class="item" id="item1">item 1</div>
  3.     <div class="item" id="item2">item 2</div>
  4.     <div class="item" id="item3">item 3</div>
  5.     <div class="item" id="item4">item 4</div>
  6.     ...
  7. </div>


These items can be added with ajax... Then I have checkboxes that I can filter some items by using jQuery slideUp/Down. If checkbox is clicked some items are hidden or shown. But as said abowe it doesn't affect the newly added items! How do I solve this problem?

Best regards,
Primoz