diff --git a/docs/Function_Init3DViewerElements.html b/docs/Function_Init3DViewerElements.html index 3f871c4..dfd33d9 100644 --- a/docs/Function_Init3DViewerElements.html +++ b/docs/Function_Init3DViewerElements.html @@ -61,16 +61,13 @@

Init3DViewerElements

-
Init3DViewerElements (onReady)
+
Init3DViewerElements ()
Description
-
Loads all the models on the page. This function looks for all the elements with online_3d_viewer class name, and loads the model according to the tag's parameters.
-
Parameters
-
-onReady -function -
-
-
Callback that called when all models are loaded. It has one parameter that is an array of the created EmbeddedViewer objects.
+
Loads all the models on the page. This function looks for all the elements with online_3d_viewer class name, and loads the model according to the tag's parameters. It must be called after the document is loaded.
+
Returns
+
+EmbeddedViewer[] +Array of the created EmbeddedViewer objects.
diff --git a/docs/Page_MigrationGuide.html b/docs/Page_MigrationGuide.html index d34e814..57bdec1 100644 --- a/docs/Page_MigrationGuide.html +++ b/docs/Page_MigrationGuide.html @@ -64,6 +64,13 @@

This document lists changes in the engine to help you to migrate your code base.

+

0.8.21

+ + + +

0.8.21

-

After placing the elements, call the Init3DViewerElements function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.

+

After placing the elements, call the Init3DViewerElements function to initalize all the viewers. It must be called after the document is loaded.

-
// tell the engine where to find the libs folder
-OV.SetExternalLibLocation ('libs');
-// init all viewers on the page
-OV.Init3DViewerElements ();
+
window.addEventListener ('load', () => {
+    // tell the engine where to find the libs folder
+    OV.SetExternalLibLocation ('libs');
+    // init all viewers on the page
+    OV.Init3DViewerElements ();
+});

Initialization from code

diff --git a/docs/source/MigrationGuide.html b/docs/source/MigrationGuide.html index 46cfa45..bd48c5d 100644 --- a/docs/source/MigrationGuide.html +++ b/docs/source/MigrationGuide.html @@ -2,6 +2,13 @@

This document lists changes in the engine to help you to migrate your code base.

+

0.8.21

+ + + +

0.8.21

-

After placing the elements, call the {@link Init3DViewerElements} function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.

+

After placing the elements, call the {@link Init3DViewerElements} function to initalize all the viewers. It must be called after the document is loaded.

-
// tell the engine where to find the libs folder
-OV.SetExternalLibLocation ('libs');
-// init all viewers on the page
-OV.Init3DViewerElements ();
+
window.addEventListener ('load', () => {
+    // tell the engine where to find the libs folder
+    OV.SetExternalLibLocation ('libs');
+    // init all viewers on the page
+    OV.Init3DViewerElements ();
+});

Initialization from code

diff --git a/sandbox/embed_background.html b/sandbox/embed_background.html index c12460a..8aad587 100644 --- a/sandbox/embed_background.html +++ b/sandbox/embed_background.html @@ -10,7 +10,9 @@