Reputation: 1384
I am changing a div's inner html by jquery's .html() method
$("#model_desc_inner").html(current_text).fadeIn("slow");
I want to apply some effect on changing of new text. For this purpose I included .fadeIn("slow")
method at the end.
But it is not including fadeIn effect on changing of new text.
Please give me some solution.
Thank you in advance.
Upvotes: 1
Views: 121
Reputation: 921
you can try this
$("#model_desc_inner").fadeOut(function() {
$(this).html(current_text).fadeIn("slow");
});
Upvotes: 1
Reputation: 144699
The method name is fadeIn
not fadein
. JavaScript is case-sensitive! Also if the "#model_desc_inner"
element is already visible, fadeIn
effectively doesn't do anything. You should at first .hide()
the element.
$("#model_desc_inner").hide().html(current_text).fadeIn("slow");
Upvotes: 2