Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Out Animation in textillate.js is not working

My code is as follows:

<div class="header">
<h1>My text</h1>
</div>
<script>
$(function(){
    $('h1').textillate({in:{} , out:{effect:'hinge'}});
});
</script>

In this, the in-animation works well but the out-animation doesn't work. You can refer to the textillate.js jquery plugin docs.

like image 539
Ram Patra Avatar asked Feb 17 '23 01:02

Ram Patra


2 Answers

The out effects are only run as a way to transition to the next in effect unfortunately. Try using empty text as the next transition:

// html
<h1 class="tlt">
    <ul class="texts">
         <li>Some Title</li>   
         <li> </li>
    </ul>
</h1>

// javascript
$('.tlt').textillate();

jsFiddle: http://jsfiddle.net/jschr/y9m3b/

https://github.com/jschr/textillate/issues/5

like image 181
jschr Avatar answered Feb 18 '23 14:02

jschr


Adding textilate('out') to the callback function for the 'in' effect worked for me.

This code executes the 'fadeOut' effect after the 'fadeIn' effect.

$('.myclass').textillate({
    loop: false,
    in : {
        effect: 'fadeIn',
        callback: function() {
            $('.myclass').textillate('out');
        }
    },
    out: {
        effect: 'fadeOut',
    }
});
like image 25
ShannonMcG Avatar answered Feb 18 '23 14:02

ShannonMcG