I am trying to animate the html part of a tag ( This Text! ) using jQuery\'s Animate function, like so:
For fadeOut => change text => fadeIn effect We need to animate the wrapper of texts we would like change.
Example below:
1400
sklepów
Some text
Lorem ipsum description
2018
$(document).ready(function(){
$('.ch-timeline .el').on('click', function(){
$('.ch-timeline .el').removeClass('current');
$(this).addClass('current');
var ilosc = $(this).data('ilosc');
var y = $(this).data('y');
var title = $(this).find('.title').html();
var desc = $(this).find('desc').html();
$('.timeline-yeardata .anime').fadeOut(400, function(){
$('#ilosc-sklepow').html(ilosc);
$('#current-year').html(y);
$('.timeline-yeardata .title').html(title);
$('.timeline-yeardata .desc').html(desc);
$(this).fadeIn(300);
})
});
});
Hope this will help someone.