开发者

Animated html5 buttons on press

I'm wondering if there is a way I can animate a button when it is pressed (NOT rolled over) using HTML5/javascript?

I want to create an almost cartoonish button that expands a little when pressed and sparkles. I know that sounds kinda gawdy but I think the final result would look better than it sounds.

My inspiration is the ? blocks in the new Super Mario Brothers gam开发者_JAVA技巧es.


What you are looking for is created by CSS3, not HTML5.

Here's a blog post with links to ten different tutorials on making all sorts of cool buttons with CSS3: http://www.catswhocode.com/blog/top-10-css3-buttons-tutorials.

Many of the buttons expand and stuff when rolled over by using the :hover selector. If you want a style to be applied when pressed, just substitute the :active selector instead.

Hope this gets you started.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜