Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this possible....multi iframes

Status
Not open for further replies.

elan

IS-IT--Management
Apr 3, 2001
24
AU
I have a page that loads an iframe. Within the iframe loads another page. At the side of the original page is a menu with five buttons. Is it possible to have script within each menu button that loads a different page in the iframe on the master page.

with thanks

Brian
 
The page with the Iframe to change and the menu must be on the same domain.

then use window.iframename.src = 'xyz';

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Many thanks for that IDMF. I have tried it a number of times without success.

My original iframe in the page when it loads has the following script:
<iframe src=" class="test1" frameborder="0" width="778" height="460"></iframe>

What would you suggest I place within the script for say button 1 to replace the above with another page.

with thanks

Brian
 
Sure you can,

name your iframe something I used iframe in this example, and then "target" the iframe like this <a href=" target="iframe">Yahoo.com</a>

here is a sample

Code:
<html>
<title>(iframe_nav)</title>
<body bgcolor="#FFFFFF">
<center>
<p>
<a href="[URL unfurl="true"]http://www.yahoo.com"[/URL] target="iframe">Yahoo.com</a> |
<a href="[URL unfurl="true"]http://www.aol.com"[/URL] target="iframe">AOL.com</a> |
<a href="[URL unfurl="true"]http://www.lycos.com"[/URL] target="iframe">Lycos.com</a> |
<a href="[URL unfurl="true"]http://www.altavista.com"[/URL] target="iframe">AltaVista.com</a>

<p>
<iframe
name="iframe"
width="600"
height="400"
src="[URL unfurl="true"]http://www.yahoo.com"[/URL]
frameborder="3"
scrolling="yes" >
</iframe>

</center>
<!--
name="iframe"
- iframe name set all links to target the iframe name when
you want the contents of the iframe to change from links
on the originating page. Link within the iframe page
should be set to target="_top" if you want the link to take
over the whole window. Place no target or target the iframe
name to replace just the iframe window
width="300"
- Width of the iframe
height="400"
- Height of the iframe
* Width and height can be expressed in pixels or percent
src="1.htm"
- Page that will fill in the iframe
frameborder="3"
- Width of the border around the iframe a
border is displayed by default
scrolling="yes"
- Allow scrollbars around the iframe for navigation
Vaild values are yes, no and auto
align=""
- Valid entries are left and right
left is set by default
-->

</body>
</html>
 
Works well for me Wulfgen. Many thanks.

Tell me ref the Yahoo button text. What should I do to change the color or even have a change of color on mouseover.

With thanks

Brian
 
That should be a simple css addition - add it ot the <head> section of your page and before the <body> section

black as the link color - red as the rollover/hover color - and blue as the linked/previously clicked on color - I also added the text decoration to none (that means no underline - if you want one then change it to underline or stikethrough -- OK - hope that works for you

Code:
<style type="text/css">
<!--
.style1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #000000;
}
a:link {
	color: #000000;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #0000FF;
}
a:hover {
	text-decoration: none;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #000000;
}
-->
</style>
 
Thanks for picking up Wulfgen, got to busy yesterday to come back! have a star.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top