开发者

Animated html5 buttons on press

开发者 https://www.devze.com 2023-03-17 05:51 出处:网络
I\'m wondering if there is a way I can animate a button when it is pressed (NOT rolled over) using HTML5/javascript?

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

精彩评论

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

关注公众号