——js.Sands——js控制css3动画触发怎么收费?

You do not have JavaScript enabled. Please enable JavaScript
to access the full features of the site or access our
Discussion
The first page of this article is displayed as the abstract.
Article type:
10.1039/TF
Trans. Faraday Soc., 1924,20, 22-29
ReferenceManager
J. W. McBain, J. H. Shaxby, A. Highfield, A. W. Porter, F. S. Spiers, Hatschek, J. N. Pring, J. Reynolds, J. S. Sand and E. Hatschek,
Trans. Faraday Soc., 1924,&20, 22
10.1039/TF
If you are not the author of this article and you wish to reproduce material from
it in a third party non-RSC publication you must
using RightsLink.
for details.
Authors contributing to RSC publications (journal articles, books or book chapters)
do not need to formally request permission to reproduce material contained in this
article provided that the correct acknowledgement is given with the reproduced material.
Reproduced material should be attributed as follows:
For reproduction of material from NJC:
Reproduced from Ref. XX with permission from the Centre National de la Recherche
Scientifique (CNRS) and The Royal Society of Chemistry.
For reproduction of material from PCCP:
Reproduced from Ref. XX with permission from the PCCP Owner Societies.
For reproduction of material from PPS:
Reproduced from Ref. XX with permission from the European Society for Photobiology,
the European Photochemistry Association, and The Royal Society of Chemistry.
For reproduction of material from all other RSC journals and books:
Reproduced from Ref. XX with permission from The Royal Society of Chemistry.
If the material has been adapted instead of reproduced from the original RSC publication
"Reproduced from" can be substituted with "Adapted from".
In all cases the Ref. XX is the XXth reference in the list of references.
If you are the author of this article you do not need to formally request permission
to reproduce figures, diagrams etc. contained in this article in third party publications
or in a thesis or dissertation provided that the correct acknowledgement is given
with the reproduced material.
Reproduced material should be attributed as follows:
For reproduction of material from NJC:
[Original citation] - Reproduced by permission of The Royal Society of Chemistry (RSC) on behalf of the
Centre National de la Recherche Scientifique (CNRS) and the RSC
For reproduction of material from PCCP:
[Original citation] - Reproduced by permission of the PCCP Owner Societies
For reproduction of material from PPS:
[Original citation] - Reproduced by permission of The Royal Society of Chemistry (RSC) on behalf of the
European Society for Photobiology, the European Photochemistry Association, and
For reproduction of material from all other RSC journals:
[Original citation] - Reproduced by permission of The Royal Society of Chemistry
If you are the author of this article you still need to obtain permission to reproduce
the whole article in a third party publication with the exception of reproduction
of the whole article in a thesis or dissertation.
Information about reproducing material from RSC articles with different licences
is available on our .
Fetching data from CrossRef.
This may take some time to load.
We welcome your comments for improvement of this site and our
Security Details
Please enter the characters in the box below as you see them.
Thank you for helping us improve our site.性能更好的js动画实现方式——requestAnimationFrame
用js来实现动画,我们一般是借助setTimeout或setInterval这两个函数,css3动画出来后,我们又可以使用css3来实现动画了,而且性能和流畅度也得到了很大的提升。但是css3动画还是有不少局限性,比如不是所有属性都能参与动画、动画缓动效果太少、无法完全控制动画过程等等。所以有的时候我们还是不得不使用setTimeout或setInterval的方式来实现动画,可是setTimeout和setInterval有着严重的性能问题,虽然某些现代对这两函个数进行了一些优化,但还是无法跟css3的动画性能相提并论。这个时候,就该requestAnimationFrame出马了。
requestAnimationFrame 是专门为实现高性能的帧动画而设计的一个API,目前已在多个浏览器得到了支持,包括IE10+,Firefox,Chrome,Safari,Opera等,在移动设备上,ios6以上版本以及IE mobile 10以上也支持requestAnimationFrame,唯一比较遗憾的是目前安卓上的原生浏览器并不支持requestAnimationFrame,不过对requestAnimationFrame的支持应该是大势所趋了,安卓版本的chrome 16+也是支持requestAnimationFrame的。
requestAnimationFrame 比起 setTimeout、setInterval的优势主要有两点:
1、requestAnimationFrame 会把每一帧中的所有DOM操作集中起来,在一次重绘或回流中就完成,并且重绘或回流的时间间隔紧紧跟随浏览器的刷新频率,一般来说,这个频率为每秒60帧。
2、在隐藏或不可见的元素中,requestAnimationFrame将不会进行重绘或回流,这当然就意味着更少的的cpu,gpu和内存使用量。
像setTimeout、setInterval一样,requestAnimationFrame是一个全局函数。调用requestAnimationFrame后,它会要求浏览器根据自己的频率进行一次重绘,它接收一个回调函数作为参数,在即将开始的浏览器重绘时,会调用这个函数,并会给这个函数传入调用回调函数时的时间作为参数。由于requestAnimationFrame的功效只是一次性的,所以若想达到动画效果,则必须连续不断的调用requestAnimationFrame,就像我们使用setTimeout来实现动画所做的那样。requestAnimationFrame函数会返回一个资源标识符,可以把它作为参数传入cancelAnimationFrame函数来取消requestAnimationFrame的回调。怎么样,是不是也跟setTimeout的clearTimeout很相似啊。
所以,可以这么说,requestAnimationFrame就是一个性能优化版、专为动画量身打造的setTimeout,不同的是requestAnimationFrame不是自己指定回调函数运行的时间,而是跟着浏览器内建的刷新频率来执行回调,这当然就能达到浏览器所能实现动画的最佳效果了。
目前,各个支持requestAnimationFrame的浏览器有些还是自己的私有实现,所以必须加前缀,对于不支持requestAnimationFrame的浏览器,我们只能使用setTimeout,因为两者的使用方式几近相同,所以这两者的兼容并不难。对于支持requestAnimationFrame的浏览器,我们使用requestAnimationFrame,而不支持的我们优雅降级使用传统的setTimeout。把它们封装一下,就能得到一个统一兼容各大浏览器的API了。
代码可以到这里来查看:/chaping/b0fd43f8c
var lastTime = 0;
var prefixes = 'webkit moz ms o'.split(' '); //各浏览器前缀
var requestAnimationFrame = window.requestAnimationF
var cancelAnimationFrame = window.cancelAnimationF
//通过遍历各浏览器前缀,来得到requestAnimationFrame和cancelAnimationFrame在当前浏览器的实现形式
for( var i = 0; i & prefixes. i++ ) {
& & if ( requestAnimationFrame && cancelAnimationFrame ) {
& & prefix = prefixes[i];
& & requestAnimationFrame = requestAnimationFrame || window[ prefix + 'RequestAnimationFrame' ];
& & cancelAnimationFrame &= cancelAnimationFrame &|| window[ prefix + 'CancelAnimationFrame' ] || window[ prefix + 'CancelRequestAnimationFrame' ];
//如果当前浏览器不支持requestAnimationFrame和cancelAnimationFrame,则会退到setTimeout
if ( !requestAnimationFrame || !cancelAnimationFrame ) {
& & requestAnimationFrame = function( callback, element ) {
& & & var currTime = new Date().getTime();
& & & //为了使setTimteout的尽可能的接近每秒60帧的效果
& & & var timeToCall = Math.max( 0, 16 - ( currTime - lastTime ) );&
& & & var id = window.setTimeout( function() {
& & & & callback( currTime + timeToCall );
& & & }, timeToCall );
& & & lastTime = currTime + timeToC
& & cancelAnimationFrame = function( id ) {
& & & window.clearTimeout( id );
//得到兼容各浏览器的API
window.requestAnimationFrame = requestAnimationF&
window.cancelAnimationFrame = cancelAnimationF
这样子我们就能在所有浏览器上使用requestAnimationFrame和cancelAnimationFrame了。
下面举个简单的例子来说明怎么运用requestAnimationFrame进行动画,下面的代码会将id为demo的div以动画的形式向右移动到300px
&div id=&demo& style=&position: width:100 height:100 background:# left:0; top:0;&&&/div&
var demo = document.getElementById('demo');
function rander(){
& & demo.style.left = parseInt(demo.style.left) + 1 + 'px'; //每一帧向右移动1px
requestAnimationFrame(function(){
& & rander();
& & //当超过300px后才停止
& & if(parseInt(demo.style.left)&=300) requestAnimationFrame(arguments.callee);Animo.js:强大的CSS动画管理工具 - Web前端 - ITeye资讯
相关知识库:
Animo.js是一个开源的、强大的CSS动画管理工具,你可以非常方便地管理Web应用中的CSS动画,同时你也可以将它当作一个动画库来使用。
通过CSS,你可以制作一些非常漂亮或令人震撼的动画效果。但是如果只使用CSS也会存在一些问题——这些动画往往会在页面加载或悬停时被触发,而不能按照想要的顺序来播放动画或者在一个动画效果完成后触发另一个动画。
Animo应运而生,通过它,你可以轻松按顺序堆放动画,或者在任何事件或任何时刻指定要播放的动画。
Animo动画库
Animo中包含了,提供了近60个非常漂亮的动画效果,此外还包含一些辅助动画,具体可参阅。
Animo依赖或更高版本。采用MIT许可协议。
详细信息和演示示例可参阅:
项目源码:
放弃ie吧,亲
IE678..不支持。。是应该的。。
我只测试了IE6,IE8都不可用,蛋痛……
IE怎么办?当前位置:&&&
JS动画函数:透明度渐变、位置移动、尺寸变化
基于JavaScript写的三个动画函数:透明度渐变、位置移动、尺寸变化。因为不喜欢臃肿的JS,所以自己写了这个,适用于做前端网页设计,只需要简单的动画效果但又不想引入整个动画类的情况下,可以使用本函数。在写js类时,需要用到简单的动画,为了降低藕合性,同样可用本函数。
以下为全部代码:
今天店里统一打电话搜集意向客户,我刚打一个,我说:很高兴为您服务。那边马上说:你高兴的太早了,立马就给挂了!!!约 10 小时前
我曾经在上海某家酒店做过三年鸭子,说实话不是一般男人受得了的。虽说收入还可以,但日夜颠倒的生活身体容易垮,还受气!稍微不注意被投诉就要扣钱。偶尔遇到变态的客人还要求说往身上倒啤酒,之后还用嘴舔一下,有些甚至要求换人……说我这个厨师做的啤酒鸭不正宗! 09:18
示例电话(eg)400-888-8888';
$("body").append(ewkefuhtml);
var xstime=200;
$(".ewclose").click(function(){
$(".im-box").hide(xstime);
$(".open-im").show(xstime);
$(".open-im").click(function(){
$(this).hide(xstime);
$(".im-box").show(xstime);
$(".wx-con").mouseenter(function(){
$(".wx-show").show(xstime);
$(".wx-con").mouseleave(function(){
$(".wx-show").hide(xstime);
$(".go-top").click(function () {
$("html,body").animate({ scrollTop : '0' }, xstime*2);
$(window).scroll(function (){
var offsetTop = 200 + $(window).scrollTop() +"px";
$(".ewkf-box").animate({top : offsetTop },{ duration:500 , queue:false });
$(window).keydown(function(event){
switch (event.which) {
$(".im-box").hide(xstime);
$(".open-im").show(xstime);
$(".open-im").hide(xstime);
$(".im-box").show(xstime);
window.open("tencent://message/?uin=&site=qq&menu=yes");Program budgeting in the Gambia
Program budgeting in the Gambia
Sands, J.S.
Access the full text:
NOT AVAILABLE
Program budgeting in the Gambia
[SISTEMAS NAC DE INVESTIGACION, GAMBIA, ELABORACION DEL PRESUPUESTO, PROGRAMAS DE INVESTIGACION]
2012/XL/XL2012_0.rdf
Other subjects
SISTEMAS NAC DE INVESTIGACION
ELABORACION DEL PRESUPUESTO
PROGRAMAS DE INVESTIGACION
In AGRIS since
Congratulations
Publications saved
Procurement
Governing Bodies
Country Offices
Follow us on
Download our App

我要回帖

更多关于 js动画插件 的文章

 

随机推荐