【发布时间】:2014-09-05 03:52:03
【问题描述】:
所以我有一个网页,其中包含 6 个 50x50 像素的不同图像的图像幻灯片。我想拥有它;当用户单击图像时,会弹出一个新窗口,其中包含相同的图像执行相同的操作,但将大小更改为 200x200px。有没有简单的方法可以做到这一点,我关闭了吗?
HTML:
JS: var mainImg = document.getElementById("slide");
var imgArray = ["slicedImg_01.gif", "slicedImg_02.gif", "slicedImg_03.gif", "slicedImg_04.gif", "slicedImg_05.gif", "slicedImg_06.gif"];
var index = 0;
function imgCycle(){
mainImg.setAttribute("src", imgArray[index]);
index++;
if (index >= imgArray.length){
index = 0;
}
}
setInterval (imgCycle,500);
function fullSize(){
var big = window.open('assignment 1.1.html')
document.getElementById("slide").height="200";
}
【问题讨论】:
标签: javascript attributes onclick window.open