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);
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);
Share
Improve this question
asked Nov 6, 2009 at 2:45
ShpigfordShpigford
25.4k61 gold badges167 silver badges262 bronze badges
3 Answers
Reset to default 6This 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.
Delay is a function method, this should work:
el.fade('out').get('tween').chain(function(){
el.destroy();
}.delay(5000));
(function(){
var el = $('fade');
el.fade('out').get('tween');
el.destroy();
}).delay(5000);