简体   繁体   English

使用CSS3实施Windows 8 Tile“ Click”动画

[英]Implement Windows 8 Tile “Click” animation with css3

If you see the video over here: http://msdn.microsoft.com/en-us/library/windows/apps/br212680.aspx , you will notice that the 2nd tile scales down immediately, stays scaled-down for few milliseconds then comes up to normal state. 如果您在此处看到视频: http : //msdn.microsoft.com/en-us/library/windows/apps/br212680.aspx ,您将注意到第二个磁贴会立即缩小,并保持缩小状态几毫秒然后恢复到正常状态。

I tried to mimic this behaviour by reducing the width and height by 2px on :active and gave background-size: cover . 我试图通过在:active上将宽度和高度减小2px来模仿这种行为,并给出background-size: cover But I am not able to create the delay in scaling back to normal with this approach. 但是我无法使用这种方法延迟恢复到正常水平。

This should be possible with CSS3 animations but I am not able to map out an approach. CSS3动画应该可以做到这一点,但我无法制定出一种方法。 Can anyone give me a direction to go from here? 谁能给我指示从这里出发的方向?

EDIT: Here's a jsfiddle of what I have tried: http://jsfiddle.net/p3Wbh/ 编辑:这是我尝试过的jsfiddle: http : //jsfiddle.net/p3Wbh/

** EDIT: **: Updated the jsfiddle: http://jsfiddle.net/p3Wbh/1/ with jQuery implementation for the "held down" effect. **编辑:**:用jQuery实现更新了jsfiddle: http//jsfiddle.net/p3Wbh/1/,以实现“抑制”效果。 Looking for a way to do this in css3. 寻找一种在css3中执行此操作的方法。

Since you are looking for javascript / winJS I can explain it ... but the css3 property I don't know about that .. 因为您正在寻找javascript / winJS,所以我可以解释一下...但是我不知道css3属性..

Pleas ego through the Gestures link Gestures 通过手势的自我感链接手势

Here use 1 -> MSPointerDown 2 -> MSPointerUp 3 -> MSPointerOver 4 -> MSPointerOut 这里使用1-> MSPointerDown 2-> MSPointerUp 3-> MSPointerOver 4-> MSPointerOut

Animate your tile by setting css properties in these events .. :) I hope this works for you ..... 通过在这些事件中设置css属性来使拼贴动画化..::)我希望这对您有用.....

Like in pointer down add the css you wrote for that pressed look and in pointer up or move add the animation + css for unpressed look ... 就像在指针下添加您为该按下的外观编写的css并在指针上移或移动时为未按下的外观添加动画+ css

Hope the suggestion helps :) 希望这个建议有帮助:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM