When classes are present at page rendering time, the following code works:
$().ready(function () {
$(".productzoom").on('hover click', function () {//also add this function to click
$(this).closest(".product1").find(".image span").css('top', $(this).position().top - 200);
$(this).closest(".product1").find(".image span").css('left', $(this).position().left + 20);
});
});
However, later I'm inserting content dynamically, the above code seems not to work anymore when I hover or click over the .productzoom class. I thought by using .on jQuery would attach the hook also on newly inserted elements, but it doesn't...why?