`
wutao8818
  • 浏览: 616589 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

script.aculo.us---Core Effects

    博客分类:
  • js
阅读更多
The six core effects Effect.Opacity, Effect.Scale, Effect.Morph, Effect.Move, Effect.Highlight and Effect.Parallel are the foundation of the script.aculo.us Visual Effects Java Script library.

Syntax
The basic syntax to start an effect is:
  new Effect.EffectName( element, required-params, [options] );

Common parameters 通用参数
All core effects support following settings in their options parameter:所有核心效果都支持这些参数!V1.0代表支持的版本

Option since Description
duration V1.0 Duration of the effect in seconds, given as a float. Defaults to 1.0.
fps V1.0 Target this many frames per second. Default to 25. Can’t be higher than 100.
transition V1.0 Sets a function that modifies the current point of the animation, which is between 0 and 1. Following transitions are supplied: Effect.Transitions.sinoidal (default), Effect.Transitions.linear, Effect.Transitions.reverse, Effect.Transitions.wobble and Effect.Transitions.flicker.
from V1.0 Sets the starting point of the transition, a float between 0.0 and 1.0. Defaults to 0.0.
to V1.0 Sets the end point of the transition, a float between 0.0 and 1.0. Defaults to 1.0.
sync V1.0 Sets whether the effect should render new frames automatically (which it does by default). If true, you can render frames manually by calling the render() instance method of an effect. This is used by Effect.Parallel().
queue V1.5 Sets queuing options. When used with a string, can be ‘front’ or ‘end’ to queue the effect in the global effects queue at the beginning or end, or a queue parameter object that can have {position:’front/end’, scope:’scope’, limit:1}. For more info on this, see Effect Queues.
delay V1.5 Sets the number of seconds to wait before the effect actually starts. Defaults to 0.0.
direction ?? Sets the direction of the transition. Values can be either ‘top-left’, ‘top-right’, ‘bottom-left’, ‘bottom-right’ or ‘center’ (Default). Applicable only on Grow and Shrink effects.



Additionally, the options parameter also can be supplied with callback methods, so you can have Java Script executed at various events while the effect is running. The callbacks are supplied with a reference to the effect object as a parameter. Here is an example of getting the element id passed by reference into a callback function:

Callback since Description
beforeStart V1.0 Called before the main effects rendering loop is started.
beforeUpdate V1.0 Called on each iteration of the effects rendering loop, before the redraw takes places.
afterUpdate V1.0 Called on each iteration of the effects rendering loop, after the redraw takes places.
afterFinish V1.0 Called after the last redraw of the effect was made.

Within the effect object, there are several useful variables you can access:

Variable since Description
effect.element V1.0 The element the effect is applied to.
effect.options V1.0 Holds the options you gave to the effect.
effect.currentFrame V1.0 The number of the last frame rendered.
effect.startOn, effect.finishOn V1.0 The times (in ms) when the effect was started, and when it will be finished.
effect.effects[] V1.0 On an Effect.Parallel effect, there’s an effects[] array containing the individual effects the parallel effect is composed of.

Example usage of Callback functions

function myCallBackOnFinish(obj){
  alert("the Element's id the effect was applied to is :" + obj.element.id);
}
function myCallBackOnStart(obj){
  alert("the Element object the effect will be applied to is :" + obj.element);
}
  new Effect.Highlight(myObject, 
    { startcolor:'#ffffff',
      endcolor:'#ffffcc',
      duration: 0.5,
      afterFinish: myCallBackOnFinish,
      BeforeStart: myCallBackOnStart });


http://wiki.script.aculo.us/scriptaculous/show/CoreEffects
Effects Treasure Chest 更多效果百宝箱?
http://wiki.script.aculo.us/scriptaculous/show/EffectsTreasureChest
分享到:
评论

相关推荐

    Prototype.and.script.aculo.us.Dec.2007.pdf

    《Prototype与script.aculo.us:深入理解与应用》一书为读者提供了全面而深入的JavaScript框架知识,尤其针对Prototype和script.aculo.us两大框架。本书不仅涵盖了基础概念,还深入探讨了高级编程技巧,旨在帮助...

    prototype and script.aculo.us框架

    script.aculo.us框架是构建在prototype之上的JavaScript脚本库,它的定位就是帮助开发人员快速有效地创建页面展示及操作的特效。 对于中小型的Ajax应用项目应用项目而言,prototype+script.aculo.us是一个非常不错的...

    《Prototype and script.aculo.us终极揭秘》

    1. **Visual Effects**:script.aculo.us提供了一系列预定义的动画效果,如淡入淡出、滑动和弹跳等,可以通过简单的API调用来实现。 2. **UI组件**:script.aculo.us包含了许多可重用的UI组件,如Autocompleter...

    Practical.Prototype.and.script.aculo.us.Jun.2008

    《实用的Prototype与script.aculo.us》一书由核心团队开发者安德鲁·杜邦(Andrew Dupont)撰写,深入探讨了Prototype与script.aculo.us这两个JavaScript库的关键方面,为读者提供了一次全面且深入的学习体验。...

    Practical Prototype and script.aculo.us

    《实用原型与script.aculo.us》(Practical Prototype and script.aculo.us)是一本由安德鲁·杜邦(Andrew Dupont)编写的关于JavaScript框架Prototype和其扩展库script.aculo.us的专业书籍。该书于2008年出版,是...

    script.aculo.us实现googleSuggest用例

    **script.aculo.us库介绍** `script.aculo.us`是一个基于JavaScript的库,它扩展了浏览器的HTML元素,为Web开发者提供了丰富的用户界面组件和动态效果。这个库是Prototype JavaScript框架的一部分,它使得创建交互...

    Prototype and script.aculo.us: You Never Knew JavaScript Could Do This

    《Prototype和script.aculo.us:JavaScript的非凡潜力》 JavaScript,一种广泛应用于Web开发的脚本语言,常常被用于创建动态、交互式的网页效果。在本文中,我们将深入探讨两个非常重要的JavaScript库——Prototype...

    Apress.Practical.Prototype.and.script.aculo.us.Jun.2008.pdf

    ### 实践指南:Prototype与script.aculo.us #### 书籍概览 《实践指南:Prototype与script.aculo.us》是一本由安德鲁·杜邦(Andrew Dupont)编写的书籍,出版于2008年6月。本书旨在帮助读者全面掌握Prototype和...

    script.aculo.us

    **script.aculo.us框架详解** `script.aculo.us`是一个基于JavaScript库的用户界面效果和交互框架,它在Web开发领域扮演着重要角色,尤其在增强用户体验方面。这个框架是AJAX(Asynchronous JavaScript and XML)...

    PHP and script.aculo.us Web 2.0 Application Interfaces.pdf.rar

    解压密码在:http://www.pin5i.com/showtopic-php-and-script.aculo.us-web-2.0-application-interfaces.html

    Prototype and script.aculo.us

    ### Prototype.js 和 Script.aculo.us 知识点详解 #### 一、Prototype.js 概述 **Prototype.js** 是一个非常优雅的 JavaScript 基础类库,它为原生 JavaScript 提供了大量的扩展,使开发者能够更加高效地进行 Web ...

    Pragmatic.Prototype.and.script.aculo.us.Dec.2007

    《Pragmatic Prototype and script.aculo.us Dec.2007》是一份关于JavaScript和Prototype库的教程资料,发布于2007年12月。这个资源旨在帮助开发者更高效地利用这两种技术来创建交互式的Web应用。JavaScript是一种...

    Javascript框架Script.aculo.us的英文文档

    ### JavaScript框架Script.aculo.us知识点概述 #### 一、简介 Script.aculo.us是一个功能强大的JavaScript库,专注于提供丰富的用户界面交互效果与控制组件。它最初是为Ruby on Rails项目设计的,但其灵活的设计使...

    Script.Aculo.Us开发系列教程

    Script.Aculo.Us开发系列教程,来自CnBlog的文章,本人搜集,下载,打包,o(∩_∩)o...

    PracticalPrototypeAndScript.aculo.us

    ### Practical Prototype and Script.aculo.us:深入学习JavaScript框架Prototype #### 概述 《Practical Prototype and script.aculo.us》是一本由Prototype框架的作者Andrew Dupont编写的书籍,主要介绍如何利用...

    script.aculo.us web 2.0 javascript

    基于Prototype框架的一个非常优秀的开源Ajax框架,封装了许多控件:AotuComplete,Accordion,Slider等,很多的动画效果,还有拖拽,DOM Utility等等 刚才在Download里面Search了一下好像没有,所以传上来一个,这个...

    前端项目-scriptaculous.zip

    **前端项目-scriptaculous.zip** 是一个包含script.aculo.us库的压缩文件,这是一个历史悠久的JavaScript库,专门用于提升Web应用程序的用户界面效果。在Web开发领域,前端项目通常是涉及HTML、CSS和JavaScript的...

    ajax特效框架

    Script.aculo.us是基于JavaScript库Prototype的一个扩展,主要提供了一系列丰富的动态效果和用户界面组件。它非常适合中小型企业使用,因为它的引入可以极大地提升网站的交互性和用户体验,同时保持较低的开发成本。...

Global site tag (gtag.js) - Google Analytics