Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mootools Delay Issue

I'm ultimately trying to delay the fade out by 5 seconds (page loads, 5 seconds later the fade out happens). But right now the bit of code below throwing a "delay is not a function" error.

el.fade('out').get('tween').chain(function(){
    el.destroy();
}).delay(5000);
like image 721
Shpigford Avatar asked Dec 30 '25 08:12

Shpigford


1 Answers

This works where el is a valid element. I used an item with id of demoitem to test it, so:

var el = $('demoitem');
(function(){
    el.fade('out').get('tween');
    el.destroy();
}).delay(5000);

delay() is a function which is can be chained to functions, not to the chain of an HTMLElement.

like image 179
artlung Avatar answered Jan 02 '26 00:01

artlung