To insert a li after #first_li with a certain speed, I do :
$("#first_li").after("<li>Hello</li>").fadeIn(500);
The insertion works but not the speed, what’s is the problem ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try setting the
lielement to be invisible before adding it to the DOM:Here is a demo: http://jsfiddle.net/hDzAS/
This selects the
#first_lielement, inserts the hiddenlielement after it, then selects the newly addedlielement and fades it in.You can also add the
lielement to the DOM like this (if you don’t like to concoct strings of HTML):Here is a demo: http://jsfiddle.net/hDzAS/2/
Docs for
.next(): http://api.jquery.com/nextUpdate
I personally like the
slideDown()effect: http://jsfiddle.net/hDzAS/1/