As mentioned i would like to know how i can apply the live() function to this code.
This code will be inserted by javascript:
<a class="link" href="url"><span>This content is hidden</span></a>
This is the javascript that needs to be live:
$('.link').append('<span class="hover"></span>').each(function () {
var $span = $('> span.hover', this).css('opacity', 0);
$(this).hover(function () {
$span.stop().fadeTo(500, 1);
}, function () {
$span.stop().fadeTo(500, 0);
});
});
A simple adding of .live(). didnt seem to do the trick
any help appreciated!