Skip to content
lachsen edited this page Dec 8, 2014 · 12 revisions

xml3d.js supports following HTML events:

onload

On elements: xml3d, mesh, shader, lightshader, data, asset, model

The onload event is triggered when all resources connected to the target have been completely loaded.

xml3d
the event is fired when all external resources (mesh data, textures etc.) have been completely loaded
mesh, shader, lightshader, data
the event is fired when all generic data (including textures) connected to these nodes has been loaded. If one of these elements includes a complex sub-graph of nested external resources, the event is fired only once all these resources have been loaded.
asset, model
the event is fired once the src-model and all ```<model></model>``` ```<assetdata></assetdata>``` and ```<assetmesh></assetmesh>``` children have been completely loaded.
For the xml3d element, the onload event fires whenever all external resources finished loading. Thus when an external reference is modified that results in the loading of a (non-cached) external resource, the onload event will fire again, once this resource (an all other loading resources) have finished loading.

For all other element, the onload event will fire again whenever any potentially external reference (such as a src attribute) within the content of the element is modified.

In addition to load events, all these elements provide the ```complete``` property which returns false if resources are currently loading for the element and true if everything has been loaded.

When onload event is triggered an inline code of the onload attribute is executed with the DOM Event object as the argument.

    &lt;xml3d xmlns=&quot;http://www.xml3d.org/2009/xml3d&quot; onload=&quot;alert('XML3D Document Loaded')&quot;&gt;&lt;/xml3d&gt;

canplaythrough

On elements: video

See https://developer.mozilla.org/en-US/docs/DOM/Media_events for details. Note: this event can only be added via addEventListener, oncanplaythrough attribute does not work.

ended

On elements: video

See https://developer.mozilla.org/en-US/docs/DOM/Media_events for details. Note: this event can only be added via addEventListener, onended attribute does not work.

Clone this wiki locally