Go Back  Xtreme Visual Basic Talk > Other Languages > Web Programming > Iframe Color


Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2003, 05:36 AM
vbSIME's Avatar
vbSIME vbSIME is offline
Regular
 
Join Date: Nov 2002
Location: NJ
Posts: 66
Default 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 ?
__________________
Micrsoft vs. Linux - It is gonna be FuN.
--------------------------------------
Visual Basic appilacation, which can easily translate metric units to nonmetric and vice versa.
SIME - download here [ http://www.geocities.com/kirillzubovsky/sime2web.html ]

Last edited by vbSIME; 02-07-2003 at 05:47 AM.
Reply With Quote
  #2  
Old 02-07-2003, 11:20 AM
IdolMind's Avatar
IdolMind IdolMind is offline
Junior Contributor
 
Join Date: Oct 2002
Location: San Diego, CA, USA
Posts: 328
Default

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>
Reply With Quote
  #3  
Old 02-07-2003, 02:32 PM
Rezner's Avatar
Rezner Rezner is offline
C# Lover

* Expert *
 
Join Date: Jan 2002
Location: 00-80-C8-C3-2E-52
Posts: 1,899
Default

Here's the IFRAME breakdown straight from MS:

http://msdn.microsoft.com/library/de...cts/IFRAME.asp
__________________
"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
Reply With Quote
  #4  
Old 02-07-2003, 02:41 PM
vbSIME's Avatar
vbSIME vbSIME is offline
Regular
 
Join Date: Nov 2002
Location: NJ
Posts: 66
Default

Can you help me to add am main.css ti the frame ???
I rean the link, but nothing works *(
__________________
Micrsoft vs. Linux - It is gonna be FuN.
--------------------------------------
Visual Basic appilacation, which can easily translate metric units to nonmetric and vice versa.
SIME - download here [ http://www.geocities.com/kirillzubovsky/sime2web.html ]
Reply With Quote
  #5  
Old 02-07-2003, 03:11 PM
IdolMind's Avatar
IdolMind IdolMind is offline
Junior Contributor
 
Join Date: Oct 2002
Location: San Diego, CA, USA
Posts: 328
Default

In the head tag of the page inside the frame:

Code:
<link rel=stylesheet type=text/css href=main.css>
Reply With Quote
  #6  
Old 02-07-2003, 06:14 PM
vbSIME's Avatar
vbSIME vbSIME is offline
Regular
 
Join Date: Nov 2002
Location: NJ
Posts: 66
Default

Ye, I've done this, but it doesn't work.
I still have the white screen and black text *(
__________________
Micrsoft vs. Linux - It is gonna be FuN.
--------------------------------------
Visual Basic appilacation, which can easily translate metric units to nonmetric and vice versa.
SIME - download here [ http://www.geocities.com/kirillzubovsky/sime2web.html ]
Reply With Quote
  #7  
Old 02-07-2003, 06:27 PM
IdolMind's Avatar
IdolMind IdolMind is offline
Junior Contributor
 
Join Date: Oct 2002
Location: San Diego, CA, USA
Posts: 328
Default

Why don't you show us the code you have?
Reply With Quote
  #8  
Old 02-07-2003, 07:05 PM
vbSIME's Avatar
vbSIME vbSIME is offline
Regular
 
Join Date: Nov 2002
Location: NJ
Posts: 66
Default

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>
__________________
Micrsoft vs. Linux - It is gonna be FuN.
--------------------------------------
Visual Basic appilacation, which can easily translate metric units to nonmetric and vice versa.
SIME - download here [ http://www.geocities.com/kirillzubovsky/sime2web.html ]
Reply With Quote
  #9  
Old 02-08-2003, 12:59 AM
IdolMind's Avatar
IdolMind IdolMind is offline
Junior Contributor
 
Join Date: Oct 2002
Location: San Diego, CA, USA
Posts: 328
Default

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.
Reply With Quote
  #10  
Old 02-09-2003, 01:17 PM
vbSIME's Avatar
vbSIME vbSIME is offline
Regular
 
Join Date: Nov 2002
Location: NJ
Posts: 66
Default

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 *(((
__________________
Micrsoft vs. Linux - It is gonna be FuN.
--------------------------------------
Visual Basic appilacation, which can easily translate metric units to nonmetric and vice versa.
SIME - download here [ http://www.geocities.com/kirillzubovsky/sime2web.html ]

Last edited by vbSIME; 02-09-2003 at 01:23 PM.
Reply With Quote
  #11  
Old 02-10-2003, 01:13 PM
vbSIME's Avatar
vbSIME vbSIME is offline
Regular
 
Join Date: Nov 2002
Location: NJ
Posts: 66
Default

Ok, I got it. My code was off, because I was testing it on the local computer *(
__________________
Micrsoft vs. Linux - It is gonna be FuN.
--------------------------------------
Visual Basic appilacation, which can easily translate metric units to nonmetric and vice versa.
SIME - download here [ http://www.geocities.com/kirillzubovsky/sime2web.html ]
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->