View Single Post
Old 04-11-2012, 04:44 AM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
I assume that those links you have in the example are just examples, otherwise you will run into cross-domain problems...

Code:
<html>
<head>
<title>Testing...</title>
</head>

<script type="text/javascript">
	imgs=Array("1.png","2.png","3.png","4.png","5.png");
	links=Array("www.vbct.ca","www.cnn.com","www.castanet.net","www.yahoo.com","www.cubaweb.cu");
	
	var x=0;

	function change() {
	y=++x%imgs.length;
		document.getElementById("changes").src=imgs[y];
		document.getElementById("theframe").src="http://"+links[y];
	}
	
</script>

<body>

<div>
	<iframe id="theframe" src="http://www.vbct.ca" style="border: 0; position:relative; top:0; left:0; right:0; bottom:0; width:100%; height:400px;" name="page" width="100%"></iframe>
</div>
<br /><br />

<div>
<a href="" target="page" onclick="change(); return false"><img src="1.png" id="changes" alt="alttext"/></a>
</div>

</body>
</html>
xelawho is offline   Reply With Quote
Users who have thanked xelawho for this post:
eliecer (04-11-2012)