Use jQuery after loading new data

Use jQuery after loading new data

I'm using infinite scroll, one that I wrote, to load new data on scroll. The data that loads is a list that I need to be able to recognize with a .hover event.

--> $(".tagItem").hover(function () { ... }

But the new data with the tagItem attribute are not recognized by the hover event.

How can I have the new data be recognized by jQuery events???

This is my infinite scroll... it works just fine. After the new data is loaded, I am unable to use jQuery hover on it.

  1.     function InfiniteScroll() {
  2.     //$('#divPostsLoader').html('<img src="http://i.imgur.com/6RMhx.gif">');
  3.     var $updatedboxes;
  4.     var itemcount = $(".masonryContainer > div").length + 1;
  5.     var daycycle = getParameterByName("d");

  6.     //alert(itemcount);
  7.     //send a query to server side to present new content
  8.     $.ajax({
  9.     type: "POST",
  10.     url: "xxxx",
  11.     data: "{itemIndex:'" + itemcount + "', dayCycleId:'" + daycycle + "'}",
  12.     contentType: "application/json; charset=utf-8",
  13.     dataType: "json",
  14.     success: function (data) {
  15.     if (data != "") {
  16.     $appendedDivs = $(data.d).css({ opacity: 0 });
  17.     $appendedDivs.imagesLoaded(function () {
  18.     // show elems now they're ready
  19.     $appendedDivs.animate({ opacity: 1 });
  20.     $('#masonryContainer').append($appendedDivs);
  21.     $('#masonryContainer').masonry('appended', $appendedDivs, true);
  22.     });
  23.     }
  24.     //$('#divPostsLoader').empty();
  25.     }
  26.     })
  27.     };