Side Effect with Animation v1.0a2 - Ext JS

本文探讨了ExtJS中元素动画效果与链式调用update方法时出现的问题,包括显示文本异常和暂停效果失效等现象,并提供了解决方案,建议使用回调函数来确保动画完成后执行更新。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I was changing up some code and wanted to point this out to see if this is an issue.

This snip works great. Props for the inline animation.
					
Ext.get('error').hide().update(response.errorMessage).slideIn("t").pause(2).slideOut("t");
but it had side effect when I put

Ext.get('error').hide().update(response.errorMessage).slideIn("t").pause(2).slideOut("t").update("");
with the update at the end it never shows any code. and doesn't react to the pause.

or

					
Ext.get('error').hide().update(response.errorMessage).slideIn("t").pause(2).slideOut("t").hide();
uses the pause but never shows the text until it slides out.

If I am not using this right then could someone please advise. If this is a bug then I hope this helps.

Tested in: IE7, FireFox
Reply With Quote
  #2  
Old 02-26-2007, 09:34 PM
Default

At the moment, it is slightly confusing, but you cannot chain just any Element methods together with effects like that. The reason is that only the Fx methods go through the internal effects queue so that they get sequenced correctly. Adding non-Fx method calls (like update) in the chain can have unexpected results.

One thing you can do is pass a callback into the effects methods, so you might try adding a separate function (it can be anonymous) that does your final update, and pass that in as the callback to your last effect so that it gets called after the slideOut completes.

We'll be sure to clarify this limitation once the docs have been updated.
__________________
Brian Moeskau
FAQ / Tutorials / User Extensions / Enhanced Forum Search
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值