HTML5 Canvas 3D WebGL (TM) js Library

opacityAtBegin Library Method

Short Description: Set opacity of associated HTML element at begin of transition

Signature: t.opacityAtBegin (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.


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

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:transition.visAtEnd - Set visibility of associated HTML element after transition
Previous Page: transition.hideAtBegin - Hide associated HTML element at begin of transition
Please Add a Comment or Question, click here!