vikmalhotra
vikmalhotra

Reputation: 10071

jquery: adding effect to changing contents of a selected element

I am trying to add an animation effect to changing contents of a selected element.

Like here's my code to change contents of a div..

$('.message').html('The product has been deleted.');

I want to add a simple slide down effect to this process. How should I do this?

Upvotes: 0

Views: 648

Answers (2)

Piksel8
Piksel8

Reputation: 1428

Just call $('.message').html('The product has been deleted.').hide().slideDown(); (http://api.jquery.com/slideDown/)

Upvotes: 2

Reigel Gallarde
Reigel Gallarde

Reputation: 65264

$('#check').click(function() {

    $('.text').html('Here is my text.').hide().slideDown('slow'); // don't forget to hide it first....

});

demo

Upvotes: 2

Related Questions