views:

125

answers:

0

I'd like to add a fade-in/fade-out effect to the error messages displayed on jquery's validate. What's the way to do this? Could I use a div and on them and work them separately? Does the plugin include this effect?

I'm using this code to place error messages (I need it for proper placing):

$("#commentForm2").validate({


        errorElement: "div",

        errorPlacement: function(error, element) {
            offset = element.offset();
            error.insertBefore(element)
            error.addClass('message');  // add a class to the wrapper
            error.css('position', 'absolute');
            error.css('left', offset.left + element.outerWidth());
            error.css('top', offset.top);
        }

    });