Difference between revisions of "Widget:RuneDisp"

From Official Runecraft Wiki
Line 22: Line 22:
 
var layer = runefiles.length;
 
var layer = runefiles.length;
  
const modelViewerLayers = document.querySelector("#MLrune");
+
const modelViewerLayers = document.querySelector("model-viewer#MLrune");
const select = document.querySelector('#layer')
+
const select = document.querySelector('#layer');
  
 
modelViewerLayers.addEventListener('load', () => {
 
modelViewerLayers.addEventListener('load', () => {
Line 41: Line 41:
 
const option = document.createElement('option');
 
const option = document.createElement('option');
 
option.value = runefile;
 
option.value = runefile;
option.textContent = 'Full Rune'
+
option.textContent = 'Full Rune';
 
select.appendChild(option);
 
select.appendChild(option);
 
});
 
});
  
 
select.addEventListener('input', (event) => {
 
select.addEventListener('input', (event) => {
// modelViewerLayers.setAttribute('src', event.target.value);
+
modelViewerLayers.setAttribute('src', event.target.value);
modelViewerLayers.src = event.target.value;
+
// modelViewerLayers.src = event.target.value;
 
});
 
});
  

Revision as of 17:04, 14 January 2022