我创建了一个html文件,其中包含所有照片和另一个html文件,我只在其中看到1个图像全尺寸。现在,如果我从第一个文件中单击一个图像,我希望使用他的src从第一个文件打开这个第二个html页面,我想要使用javascript。 (是的,我知道我可以创建20个HTML文件,其中每个人都有不同的照片,但我希望只使用1 HTML文件)打开大量图像到1个html页面中
文件1 =“的index.html”:
<a href="work_detail.html" ><img src="images/templatemo_image_01_big.jpg" alt="image"
width="100%" height="100%" id="pic1" onClick="hello();" /></a>
文件2 = “work_detail.html”:
<a target="_parent"><img src="" alt="product" id="work" /></a>
的JavaScript:
function hello(){
var pic1 = document.getElementById('pic1').src;
document.getElementById('work').src= pic1;
}
如何第一ID与第二id其中不乏连接在不同的文件使用JavaScript?
它看起来太复杂了,我认为不是我要找的 – 2013-03-11 23:15:28