日期:2014-05-16  浏览次数:20317 次

点击图片链接问题!
在一个网页里面,包含了一个 <iframe> 框架, <iframe> 里面的网页是一组图片,包含 <iframe> 的网页有个大图片,要求点击 <iframe> 里面的图片,然后包含 <iframe> 的网页上的大图片路径变为所点击的图片路径,这个该怎么实现(同一个页面的我知道是id.src=,但是,小图片是在 <iframe> 里面的,我不知道了,向请教各位大侠!谢谢!)?

------解决方案--------------------
在inframe对象中
function test(obj){
alert(obj.src);
parent.document.body.background =obj.src;
}

<table border= "1 " width= "100% " id= "table1 ">
<tr>
<td>
<img border= "0 " src= "xtree117/xtree/tree/openFolder.gif " width= "24 " height= "22 " onclick= "test(this) "> </td>
<td>
<img border= "0 " src= "xtree117/xtree/tree/openinFolder.gif " width= "24 " height= "22 " onclick= "test(this) "> </td>
</tr>
<tr>
<td>
<img border= "0 " src= "xtree117/xtree/tree/plus.gif " width= "16 " height= "22 " onclick= "test(this) "> </td>
<td>
<img border= "0 " src= "xtree117/xtree/tree/minus.gif " width= "16 " height= "22 " onclick= "test(this) "> </td>
</tr>
</table>