0
我想將div onclick縮放到25%,並將onclick縮小到50%。 爲什麼它不縮小到50%?Javascript最小化和最大化
var minimize = document.getElementById('minimize');
var container = document.getElementById('container');
minimize.onclick = function(){
if(container.style.width = "50%") {
container.style.width = "25%";
container.style.height = "25%";
}else{
container.style.width = "50%";
container.style.height = "50%";
}
console.log(container.style.width);
}
}
謝謝!它工作得很好! – vdhmartijn