Difference between revisions of "Widget:3DModel"

From Dragalia Lost Wiki
Jump to navigation Jump to search
imported>Elaeagnifolia
(Created page with "<includeonly> <div id="modelViewer"><iframe width="400px" height="400px" src="https://poly.google.com/view/7S97pOzmItM/embed" frameborder="0" style="border:none;" allowvr="yes...")
imported>Elaeagnifolia
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>
+
<includeonly><div id="modelViewer<!--{$secondModel}-->">
<div id="modelViewer"><iframe width="400px" height="400px" src="https://poly.google.com/view/7S97pOzmItM/embed" frameborder="0" style="border:none;" allowvr="yes" allow="vr; xr; accelerometer; magnetometer; gyroscope; autoplay;" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel="" ></iframe></div>
+
    <a href="">Load 3D Model</a>
</includeonly>
+
</div></includeonly>
 +
<script>
 +
    document.querySelector("#modelViewer<!--{$secondModel}--> a").addEventListener("click", function(e) {
 +
        document.querySelector("#modelViewer<!--{$secondModel}-->").innerHTML = '<iframe width="400px" height="400px" src="https://poly.google.com/view/<!--{$embedSrcLink}-->/embed" frameborder="0" style="border:none;" allowvr="yes" allow="vr; xr; accelerometer; magnetometer; gyroscope; autoplay;" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel="" ></iframe>';
 +
    e.preventDefault();
 +
  e.stopPropagation();
 +
    }, false);
 +
</script>

Latest revision as of 21:41, 12 January 2019

<script>

   document.querySelector("#modelViewer a").addEventListener("click", function(e) {
       document.querySelector("#modelViewer").innerHTML = '<iframe width="400px" height="400px" src="https://poly.google.com/view//embed" frameborder="0" style="border:none;" allowvr="yes" allow="vr; xr; accelerometer; magnetometer; gyroscope; autoplay;" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel="" ></iframe>';
    e.preventDefault();
  e.stopPropagation();
   }, false);

</script>