0
我有我的页面上的AJAX动画扩展其变动对不同的事件,这样的按钮颜色:Qunit与AJAX动画扩展
按钮和扩展的代码是:
asp:Button ID="target" runat="server" Text="Animate Me" OnClientClick="return false;">
/asp:Button>
aspext:AnimationExtender ID="extender" runat="server" TargetControlID="target">
Animations>
OnLoad><StyleAction Attribute="backgroundColor" Value="red" /></OnLoad>
OnClick><StyleAction Attribute="backgroundColor" Value="blue" /></OnClick>
OnMouseOver><StyleAction Attribute="backgroundColor" Value="blue" />/OnMouseOver>
<OnMouseOut><StyleAction Attribute="backgroundColor" Value="green" /></OnMouseOut>
OnHoverOver><StyleAction Attribute="color" Value="blue" /></OnHoverOver>
OnHoverOut><StyleAction Attribute="color" Value="yellow" /></OnHoverOut>
/Animations>
/aspext:AnimationExtender>
我已经Qunit测试写上document.ready,它将按钮的背景颜色与负载上的预期值匹配,如下所示。
$(document).ready(function() {
module('Animation OnLoad tests');
test(' Animation OnLoad ', function() {
panel = $('#target');
var actual = panel.css("background-color");
equals(actual, "red", 'Event failed to fire');
});
});
,但问题在于,试运行增量改变按钮的颜色之前,我也试过页面加载,而不是的document.ready,但同样的问题。请建议我解决这个问题。
谢谢。
任何线索如何在页面加载后将我的QUni测试花费时间? – DotnetSparrow 2011-02-26 11:01:54