📌  相关文章
📜  在特定位置的 div 中添加图像 javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:17.877000             🧑  作者: Mango

代码示例1
function updateDiv(id, width, height, left, top, opacity) 
{ 
    var mydiv = document.getElementById(id);
    mydiv.setAttribute('id', id);  

    mydiv.style.width =  width + "px";     
    mydiv.style.height = height + "px";     

    mydiv.style.position = "absolute"; 
    mydiv.style.left = left + "px";         
    mydiv.style.top = top + "px";  

    mydiv.style.opacity = opacity;
}