It's my first post so let me say Hello! everyone ;)
I have problem with animation. I would like to reach this effect:
- show text "Lorem ipsum 1" and then animate it to 'opacity: 0'
- run delay
- change text to "Lorem ipsum 2" when it is not visible
- show text using animate to 'opacity: 1'
But my code changes text on a very beginning. So I can't even see "Lorem ipsum 1".
I've tried to add .stop() and .queue() code but also doesn't work correctly(or I didn't use it right way).
I'll be appreciate for advise and explain why code is not execute step by step and how to get it.
$(document).ready(function(){
$('body').append('<p>Lorem ipsum 1</p>');
$('p')
.animate({opacity: '0'}, 'slow')
.delay(1000)
.text('Lorem ipsum 2')
.animate({opacity: '1'}, 'slow');
});