-
Notifications
You must be signed in to change notification settings - Fork 25
Events
xml3d.js supports following HTML events:
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 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.
<xml3d xmlns="http://www.xml3d.org/2009/xml3d" onload="alert('XML3D Document Loaded')"></xml3d>
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.
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.