HTML5 Canvas 3D WebGL (TM) js Library
 

opacity Library Method

Short Description: Set opacity of associated HTML element

Signature: t.opacity (o)
Group: HTMLControl
Class: transition Class
 

Sets the opacity to o of the element associated with the current transition before playing the main animation. The current implementation actually performs the style change immediately when called.

Setting opacity to 0, i.e. making the element totally transparent, is another way of hiding an element. In contrast to setting visibility to hidden however a totally transparent HTML element still receives mouse events. This is sometimes very useful, if the HTML element is drawn on canvas while the HTML element itself is shown transparently (i.e. not shown) but still receives mouse events. See forwardingController Note 2 for an example.

Examples

taccgl.a("testimg").paint().opacity().opacityFinal().to(500,500,1).start();
RUN
taccgl.a("testimg").paint().opacity(0.5).opacityFinal().to(500,500,1).start();
RUN
taccgl.a("testimg").paint().opacityFinal().to(500,500,1).start();
RUN
taccgl.a("testimg").startTime(1).paint().opacity().opacityFinal().to(500,500,1).start();
RUN
taccgl.a("testimg").startTime(1).paint().opacity().opacityFinal().showBefore().to(500,500,1).start();
RUN

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:transition.visFinal - Set visibility of associated HTML element after complete animation
Previous Page: transition.hide - Hide associated HTML element