How to change innerHTML with plugin content
-
Hi, I need to change div content on button pressed. I am using Canvasio3D Light plugin and my div looks like this:
<div id=”models” style=”width: 940px; margin:0 auto; display: block;”>
[canvasio3D width=”940″ height=”390″ border=”1″ borderCol=”#F6F6F6″ dropShadow=”0″ backCol=”#FFFFFF” backImg=”https://automobiliai.ml/wp-content/uploads/2019/03/background1.jpg” mouse=”on” rollMode=”off” rollSpeedH=”0″ rollSpeedV=”0″ objPath=”https://automobiliai.ml/wp-content/uploads/2019/03/akena.obj” texturPath=”https://automobiliai.ml/wp-content/uploads/2019/03/akena_white.jpg” objScale=”1.5″ objColor=”” lightSet=”6″ reflection=”off” refVal=”5″ objShadow=”off” floor=”off” floorHeight=”0″ lightRotate=”off” vector=”off” mousewheel=”on” Help=”off”] [/canvasio3D]
</div>This part of code works well but I want to change it (load new model) on button pressed and this part of code displays only like text:
document.getElementById(“models”).innerHTML = ‘[canvasio3D width=”940″ height=”390″ border=”1″ borderCol=”#F6F6F6″ dropShadow=”0″ backCol=”#FFFFFF” backImg=”https://automobiliai.ml/wp-content/uploads/2019/03/background1.jpg” mouse=”on” rollMode=”off” rollSpeedH=”0″ rollSpeedV=”0″ objPath=”https://automobiliai.ml/wp-content/uploads/2019/03/akena.obj” texturPath=”https://automobiliai.ml/wp-content/uploads/2019/03/akena_white.jpg” objScale=”1.5″ objColor=”” lightSet=”6″ reflection=”off” refVal=”5″ objShadow=”off” floor=”off” floorHeight=”0″ lightRotate=”off” vector=”off” mousewheel=”on” Help=”off”] [/canvasio3D]’;
Of course, I could create 27 divs with different models and show only 1 of them but plugin works only with 15 models in 1 web page and it would be a lot of code.. It is not working probably because it is not a HTML element but maybe somebody is facing it and know the best solution for this. I need to change only the texturPath of each model.
- The topic ‘How to change innerHTML with plugin content’ is closed to new replies.