2 回答

TA贡献1853条经验 获得超6个赞
在添加新的图像堆栈之前,我通过添加一个清除所有代码的删除循环来修复它。
var images= images10;
var stack = new ImageStack({
images: images,
height: '512px',
width: '512px'
});
document.querySelector('.example').appendChild(stack);
function softtissue(){
let element = document.querySelector(".example");
while (element.firstChild) {
element.removeChild(element.firstChild);
}
var images= images10;
var stack1 = new ImageStack({
images: images,
height: '512px',
width: '512px'
});
document.querySelector('.example').appendChild(stack1);
}
function bone(){
let element = document.querySelector(".example");
while (element.firstChild) {
element.removeChild(element.firstChild);
}
var images= imagesbone;
var stack2 = new ImageStack({
images: images,
height: '512px',
width: '512px'
});
document.querySelector('.example').appendChild(stack2);
}
function lung(){
let element = document.querySelector(".example");
while (element.firstChild) {
element.removeChild(element.firstChild);
}
var images= imageslung;
var stack3 = new ImageStack({
images: images,
height: '512px',
width: '512px'
});
document.querySelector('.example').appendChild(stack3);
}
添加回答
举报