 |
 |

02-07-2003, 05:36 AM
|
 |
Regular
|
|
Join Date: Nov 2002
Location: NJ
Posts: 66
|
|
Iframe Color and behavio
|
Does anyone knows how to change <iframe> backgroung color ?
And how t omake on-click event to change the iframe inside text ?
|
Last edited by vbSIME; 02-07-2003 at 05:47 AM.
|

02-07-2003, 11:20 AM
|
 |
Junior Contributor
|
|
Join Date: Oct 2002
Location: San Diego, CA, USA
Posts: 328
|
|
If you want to change the background color of the iframe you need to set the background color of the html page that the iframe is displaying. Say your iframe looks like this:
Code:
<iframe src=mypage.htm></iframe>
The page, "mypage.htm" should have something like this:
Code:
...
<body bgcolor=blue>
<!-- some html here -->
</body>
...
As for the click event, here is an example:
Code:
<head>
<script language=vbscript>
Function changePage()
fraTemp.Navigate "http://www.xtremevbtalk.com"
End Function
</script>
</head>
<body>
<button onclick=changePage>Change</button>
<iframe id=fraTemp src=http://www.yahoo.com></iframe>
</body>
|
|

02-07-2003, 02:32 PM
|
 |
C# Lover
* Expert *
|
|
Join Date: Jan 2002
Location: 00-80-C8-C3-2E-52
Posts: 1,899
|
|
__________________
"Man is still the best computer we can put aboard a spacecraft...and the only one that can be mass produced with unskilled labor." - Wernher von Braun
|

02-07-2003, 02:41 PM
|
 |
Regular
|
|
Join Date: Nov 2002
Location: NJ
Posts: 66
|
|
|
Can you help me to add am main.css ti the frame ???
I rean the link, but nothing works *(
|
|

02-07-2003, 03:11 PM
|
 |
Junior Contributor
|
|
Join Date: Oct 2002
Location: San Diego, CA, USA
Posts: 328
|
|
In the head tag of the page inside the frame:
Code:
<link rel=stylesheet type=text/css href=main.css>
|
|

02-07-2003, 06:14 PM
|
 |
Regular
|
|
Join Date: Nov 2002
Location: NJ
Posts: 66
|
|
|
Ye, I've done this, but it doesn't work.
I still have the white screen and black text *(
|
|

02-07-2003, 06:27 PM
|
 |
Junior Contributor
|
|
Join Date: Oct 2002
Location: San Diego, CA, USA
Posts: 328
|
|
|
Why don't you show us the code you have?
|
|

02-07-2003, 07:05 PM
|
 |
Regular
|
|
Join Date: Nov 2002
Location: NJ
Posts: 66
|
|
|
Here we are :
<code>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>title</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link href="/main.css" rel="stylesheet" type="text/css">
<script language=vbscript>
Function changePage()
fraTemp.Navigate "collector/main.htm"
End Function
Function changePage1()
fraTemp.Navigate "collector/books.htm"
End Function
Function changePage2()
fraTemp.Navigate "collector/spb.htm"
End Function
Function changePage3()
fraTemp.Navigate "collector/moscow.htm"
End Function
Function changePage4()
fraTemp.Navigate "collector/usa.htm"
End Function
Function changePage5()
fraTemp.Navigate "collector/usacities.htm"
End Function
Function changePage6()
fraTemp.Navigate "collector/washington.htm"
End Function
Function changePage7()
fraTemp.Navigate "collector/cooper.htm"
End Function
Function changePage8()
fraTemp.Navigate "collector/edison.htm"
End Function
Function changePage9()
fraTemp.Navigate "collector/myday.htm"
End Function
Function changePage10()
fraTemp.Navigate "collector/environment.htm"
End Function
Function changePage11()
fraTemp.Navigate "collector/olimpic.htm"
End Function
Function changePage12()
fraTemp.Navigate "collector/sport.htm"
End Function
Function changePage13()
fraTemp.Navigate "collector/shop.htm"
End Function
</script>
</head>
<body>
<!-- main table-->
<table width="700" height="500" align="center" class="main_table" valign='center' >
<tr>
<td>
<!-- top table -->
<table border="0" height="77" width="690" valign="top">
<tr>
<td height="80"><center>*******Doesn't matter</center></td>
</tr>
</table>
<!-- top table is over -->
<!-- menu table-->
<table border="0" height="350" >
<tr>
<td width="150">
<!--Menu-->
<table>
<tr onclick=changePage>
<td class="link">
На главную
</td>
</tr>
<tr onclick=changePage1>
<td class="link">
Книги
</td>
</tr>
<tr onclick=changePage2>
<td class="link">
Санкт-Петербург
</td>
</tr>
<!--....... lots of <tr>.....--!>
<tr onclick=changePage11>
<td class="link">
Олимпийские Игры
</td>
</tr>
<tr onclick=changePage12>
<td class="link">
Спорт
</td>
</tr>
<tr onclick=changePage13>
<td class="link">
Покупки
</td>
</tr>
</table>
<!--Menu is over-->
</td>
<!-- menu table is over-->
<!-- text-->
<td width="540">
<iframe bordercolor="white" STYLE="background-color:blue" id=fraTemp src=/main.htm frameborder="1" width="530" height="400" scrolling="auto" title="TextArea" class="iframe"></iframe>
</td
></tr>
</table>
<!--text is over-->
</td>
</tr>
</table>
<!-- main table is over -->
</body>
</html>
</code>
|
|

02-08-2003, 12:59 AM
|
 |
Junior Contributor
|
|
Join Date: Oct 2002
Location: San Diego, CA, USA
Posts: 328
|
|
|
Whatever page is displayed in the iframe is going to show with it's own styles. You can't see the background of the iframe anyway. Therefore setting the background color on the iframe is not what you want to do. You should be setting it on the body of the main.htm file.
Also, I think that your path are off. If the main.css file is in the same directory as this one than don't use the forward slash. Just href=main.css. Same with the other file names.
One more thing. You can design the page changing function part more effiently. Instead, use one function that handles the click event of each link.
|
Last edited by IdolMind; 02-08-2003 at 01:05 AM.
|

02-09-2003, 01:17 PM
|
 |
Regular
|
|
Join Date: Nov 2002
Location: NJ
Posts: 66
|
|
|
I did everything possile, but when I open index.shtml the test frame the frame is still without any classes...
I put the class in frame - doesn't work
-----//----------- in the page inside the frame - doesn't work *(((
|
Last edited by vbSIME; 02-09-2003 at 01:23 PM.
|

02-10-2003, 01:13 PM
|
 |
Regular
|
|
Join Date: Nov 2002
Location: NJ
Posts: 66
|
|
|
Ok, I got it. My code was off, because I was testing it on the local computer *(
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|