简体   繁体   English

如何使用 javascript 制作动画网站

[英]How to make animated websites with javascript

I hve seen a couple of really cool websites that are animated with javascript.我见过几个非常酷的网站,它们使用 javascript 制作动画。 Google have done a few animated interactive logos and this site too is animated with javascript (not the flash bit clearly).谷歌已经做了一些动画互动标志,这个网站也用 javascript 动画(不是 flash 位清楚)。

Well how to do it?那么怎么做呢? Is there some tool, framework etc that people use?是否有一些人们使用的工具、框架等? I only know of jquery.我只知道jquery。

Here's the rulebook: http://api.jquery.com/animate这是规则手册: http://api.jquery.com/animate

Here's the playground: http://jsfiddle.net这里是操场: http://jsfiddle.net

Have fun.玩得开心。

jQuery is the best framework to use as a base. jQuery 是用作基础的最佳框架。 It handles all the cross-browser idiosyncrasies.它处理所有跨浏览器的特性。

Check out jQuery UI.查看 jQuery UI。

http://jqueryui.com/demos/ http://jqueryui.com/demos/

If your audience is newer, you should also consider CSS 3 Transitions .如果您的受众较新,您还应该考虑CSS 3 Transitions

 .animated {
   transition: all 0.3s linear;
   -webkit-transition: all 0.3s linear;
   -moz-transition: all 0.3s linear;  
   -o-transition: all 0.3s linear;
 }

Changing a style property for any element with this class will transition to its new property.使用此 class 更改任何元素的样式属性将转换到其新属性。 Eg adjusting "margin-left" from 0px to 100px will cause a slide to the right;例如,将“margin-left”从 0px 调整为 100px 会导致向右滑动; adjusting "background-color" from "red" to "blue" will cause a cool color-change effect.将“background-color”从“red”调整为“blue”会产生很酷的变色效果。 Give it a go!搏一搏!

For browser compatibility, check out caniuse-- transitions .对于浏览器兼容性,请查看caniuse--transitions Happy coding!快乐编码!

I prefer SVG for interactive graphics, if you prefer Vector Graphics.如果您更喜欢矢量图形,我更喜欢 SVG 用于交互式图形。 I would suggest using Adobe Illustrator or something similar to produce the graphics and then use Raphael to animate it.我建议使用 Adobe Illustrator 或类似的东西来生成图形,然后使用Raphael对其进行动画处理。 If you want a really good introduction, go for the really good PeepCode Episode .如果你想要一个非常好的介绍,go 是非常好的PeepCode Episode

From examining their source it looks like volll rolled their own method of animation using javascript.通过检查他们的来源,看起来 volll 使用 javascript 推出了他们自己的 animation 方法。

If you want to make graphical animations on your own site I would suggest having a look at the HTML5 canvas tag.如果您想在自己的网站上制作图形动画,我建议您查看 HTML5 canvas 标签。 https://developer.mozilla.org/en/Canvas_tutorial https://developer.mozilla.org/en/Canvas_tutorial

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

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