Pedro Pedro - 1 month ago 6
jQuery Question

mouseover with fadein effect

Im applying a fade in when a user mouseover a element, but is not working, here is my code line:

$(this.svgElement).on('mouseover', '.' + jsTagClass, $.proxy(this.onTagClick, this)).fadeIn(2000);

Answer

Use the fadeIn in the callback function of your mouseover event listener like this:

$(this.svgElement).on('mouseover', '.' + jsTagClass, function() {
    $(this).fadeIn(2000);
});

If the given variables have the right values, this will work.