I want to animate my heading whenever the window is resized into pc and mobile view but Textilate only executes on reload.
This is my code:
function animateHeading() {
$('#skysea').textillate({
in: { effect: 'fadeInRight' }
});
$('#on').textillate({
initialDelay: 300,
in: { effect: 'fadeInRight' }
});
$('#cloud').textillate({
initialDelay: 500,
in: { effect: 'fadeInRight' }
});
}
$(window).resize(function() {
if($(window).width() < 769) {
animateHeading();
}
if($(window).width() >= 769) {
animateHeading();
}
});
I want to animate text when the window is resized to pc or mobile view without reloading the page.