While you can use More to highlight an element, using a delay or chain is not difficult.
Here's the fiddle: http://jsfiddle.net/kLn77n6t/2/
Method # 1:
function inout(el){ el.fade('in').fade.delay(1000, el, 'out'); } inout($('fader'));
(We pass the delay () element, because otherwise it does not know what "this" is.)
Method # 2:
Same as before, but using CSS classes to set the attenuation properties and add and remove a class:
<style> #fader{opacity:0; transition:opacity 0.5s ease;} #fader.show{opacity:1} </style> <script> function inout(el){ el.addClass('show').removeClass.delay(1000, el, 'show'); } inout($('fader')); </script>
Method 3:
The "right" method should be in a chain of teenagers, but I have not tried.
If you need it, write a comment. The Hacky chain does not work:
$('fader').set('tween', {duration:'long', link: 'chain'}); function inout(){ $('fader').tween('opacity',1).tween('opacity',0); }
Good luck
SamGoody
source share