我试图捕捉元素动画中的特定时刻.含义 - 我希望动画在X点开始和停止(让我们说在100秒动画的第二个5开始和停止).
这是我对 JSFiddle的看法
@-webkit-keyframes background {
from { background: yellow; }
100% {
background: blue;
}
}
div {
-webkit-animation-name: background;
-webkit-animation-duration: 100s;
-webkit-animation-fill-mode: forwards;
-webkit-animation-delay: -40s;
-webkit-animation-play-state: paused;
}
Run Code Online (Sandbox Code Playgroud)
这似乎在Chrome和Firefox中运行良好,但似乎无法在Safari和IE中运行(不,对吧?!)注意:我故意留下前缀,专门在Safari上测试它.
与Chrome不同,似乎动画永远不会在Safari中启动,并且仍处于初始阶段.
这是一个已知的问题?是否有解决方法或其他方式来实现这一点?
UPDATE /澄清
我需要的是能够捕获动画的特定FRAME.在Chrome中打开我的小提琴,在我的小提琴中播放动画延迟属性(确保它仍然是负数).您将看到的是,您可以捕获动画的1个特定帧.这正是我需要的.我的问题是这在Safari中不起作用.
我的问题主要是关于测试方法.我在一个实施TDD(测试驱动开发)的组织工作.我们正在使用AngularJS,因此它的完整测试堆栈 - 用于单元测试的Jasmine和用于e2e测试的Protractor.
在开发特征时,我们的过程首先编写失败的e2e测试,然后使用TDD编写特征.测试仅针对公共方法编写(无论是控制器/指令/服务).它自己的产品不包含任何复杂的逻辑(除了几个例外).最近我们开始讨论这样一个事实,即为控制器编写单元测试是没有意义的,因为它们暴露了功能,100%暴露在视图中并且无论如何都使用e2e测试进行了测试.基本上 - 单元测试和e2e测试是重叠的.起初我们都同意了,但随后这个决定打开了潘多拉盒子.毕竟,关于指令也可以说同样的事情.那么为什么要测试它们呢?然后出现了服务问题.他们中的大多数(98%)只是进行后端呼叫并返回响应.那么为什么不简单地模拟httpBackend并在测试控制器时测试服务,这些控制器是通过e2e测试的.
你得到漂移......
我确实看到了进行单元测试和e2e测试的好处,尽管它们实际上是重叠的.主要是 - 即时反馈和"可执行文档".你在练什么?您是否看到其他好处并且是"值得挤压的果汁" - 为了获得上述两个好处,是否值得为最简单的实施编写重叠测试?
我试图删除我设置的页脚使用我用来设置它的相同参考.然而,没有任何反应.
protected void onPostExecute(ArrayList<Recipe> result) {
int CHEF_ID = ChefsRecipeList.this.getIntent().getIntExtra("CHEF_ID", 0);
ListView recipeListView = (ListView)findViewById(android.R.id.list);
View footer = getLayoutInflater().inflate(R.layout.chef_recipe_list_footer, null);
if(!addToExisting){
RecipeManager.getInstance().setRecipeList(result);
View header = getLayoutInflater().inflate(R.layout.chef_recipe_list_header, null);
ImageView loadButton = (ImageView)footer.findViewById(R.id.loadmore);
loadButton.setOnClickListener( new OnClickListener() {
@Override
public void onClick(View v) {
int CHEF_ID = ChefsRecipeList.this.getIntent().getIntExtra("CHEF_ID", 0);
try {
Log.d("NXTLAOD", "http://api.foodnetworkasia.com/api/mobile/get_recipes?chefId="+ChefManager.getInstance().getChef(CHEF_ID).getId()+
"&format=xml&startIndex="+(RecipeManager.getInstance().getRecipeList().size()+1)+"&endIndex="+(RecipeManager.getInstance().getRecipeList().size()+24));
new XMLRecipesParser(true).execute(new URL[] { new URL("http://api.foodnetworkasia.com/api/mobile/get_recipes?chefId="+ChefManager.getInstance().getChef(CHEF_ID).getId()+
"&format=xml&startIndex="+RecipeManager.getInstance().getRecipeList().size()+"&endIndex="+(RecipeManager.getInstance().getRecipeList().size()+24)) } );
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
ImageView chefPhoto = (ImageView)header.findViewById(R.id.chef_photo);
chefPhoto.setImageBitmap(ImageURLLoader.LoadImageFromURL(ChefManager.getInstance().getChef(CHEF_ID).getLargeURL()));
TextView …Run Code Online (Sandbox Code Playgroud)