Skip to main content

canvasSelector

Typestring
Default"canvas"

CSS Selector string for the canvas element.
By default, View3D will select the first <canvas> element inside the wrapper.
To change this behavior, you can use specific CSS selector to target the element.

<div id="wrapper" class="view3d-wrapper">
<canvas id="NOT_ME"></canvas>
<canvas id="SELECT_ME" class="view3d-canvas"></canvas>
</div>
new View3D("#wrapper", {
canvasSelector: "#SELECT_ME"
})