Javascript 在新窗口中更改图像的属性

Javascript 在新窗口中更改图像的属性,javascript,attributes,onclick,window.open,Javascript,Attributes,Onclick,Window.open,因此,我有一个网页,有一个6个不同的图像50x50像素的图像幻灯片。我想这样做;当用户单击图像时,会弹出一个新窗口,显示相同的图像,但将其大小更改为200x200px。有没有一个简单的方法可以做到这一点,我接近了吗 HTML: JS: var mainImg=document.getElementById(“幻灯片”) 您可以使用普通javascript使用窗口对象访问子元素 var big = window.open('assignment 1.1.html') big.document.g

因此,我有一个网页,有一个6个不同的图像50x50像素的图像幻灯片。我想这样做;当用户单击图像时,会弹出一个新窗口,显示相同的图像,但将其大小更改为200x200px。有没有一个简单的方法可以做到这一点,我接近了吗

HTML:

JS: var mainImg=document.getElementById(“幻灯片”)


您可以使用普通javascript使用窗口对象访问子元素

var big = window.open('assignment 1.1.html')
big.document.getElementById("slide").height="200";
检查这个问题及其答案,希望它能帮助你

var big = window.open('assignment 1.1.html')
big.document.getElementById("slide").height="200";