473,394 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

I need to have dynamic tab color

1
i have a special problem in the project.

i have a page with tabs, the tabs are done in html pages and no images are used.

here is the code what i am doing :

[HTML]<table border="0" cellpadding="0" cellspacing="0" width="42%" id="table3">
<br>
<tr> <!-- #014F96 -->

<script>alert(document.write('bag'));</script>
<td align="center" bgcolor="document.write(bag)"width="25%"><b><font face="Verdana">
<a class="lnk" href="javascript: shInstructions(1);">
<font color="#FFFFFF" size="2">Qualification</font></a></font></b></td>
<td align="center" width="1%">&nbsp;</td>
<td align="center" style="border: 1px solid #014F96; padding: 0" width="25%">
<font face="Verdana" size="2">
<a href="javascript: shInstructions(2);">Experience</a></font></td>
<td align="center" width="1%">&nbsp;</td>
<td align="center" width="30%" style="border: 1px solid #014F96; padding: 0">
<font face="Verdana" size="2">
<a href="javascript: shInstructions(3);">Family Details</a></font></td>
</tr>
</table>
[/HTML]
i am calling a function shinstruction which does hiding of tables below.

now when a user clicks the next tab the bg color has to change and the tab from where he moves has to come to the original color.

How do i do this ?? Using javascript.

I checked with document .write(bg) --> this was a variable that i was passing from the javascript below :

Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2.     function shInstructions(gg)
  3.     {        
  4.  
  5.         if (gg==1)
  6.         {
  7.  
  8.         if (window.qual.style.display == "none")
  9.  
  10.             window.qual.style.display = ""                    
  11.         else
  12.             window.qual.style.display = ""
  13.             window.exp.style.display = "none"
  14.             window.family.style.display = "none"
  15.             var bag="white"
  16.  
  17.         }        
  18.         if (gg==2)
  19.         {
  20.         if (window.exp.style.display == "")
  21.             window.exp.style.display = ""
  22.  
  23.  
  24.         else            
  25.             window.qual.style.display = "none"
  26.             window.exp.style.display = ""
  27.             window.family.style.display = "none"
  28.  
  29.  
  30.  
  31.         }
  32.         if (gg==3)
  33.         {
  34.         if (window.family.style.display == "")
  35.             window.family.style.display = ""
  36.  
  37.  
  38.         else            
  39.             window.qual.style.display = "none"
  40.             window.exp.style.display = "none"
  41.             window.family.style.display = ""
  42.  
  43.         }
  44.  
  45.     }
  46. </script>
Pls help & suggest.
Jan 25 '07 #1
1 1425
acoder
16,027 Expert Mod 8TB
document.write() doesn't work like that.

Use the style.backgroundColor property to change the background color.
Jun 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Marc | last post by:
Hello, I've fiddled with this for quite a while and thought I had the problem solved. I had a version that would successfully compile and run. But then I had to change the code to use a...
5
by: Ralph | last post by:
Hi all, I'm a newbie to MS-SQL UDFs and seem to have a real big problem. I need to implement a logic to receive an adress build out of various user definable fields from various user defined...
7
by: Snake | last post by:
Hi guys, I have question about classes. when u create class called Test. and you define variable Test c; so does this act like( a variable c of type Test pointing to an abject )? The thing that...
1
by: Richard Hollenbeck | last post by:
Hello Newsgroup. You have all been very helpful in the past and I thank you. I try to ask relevant questions so that they don't just benefit me, but also benefit the group. I'm currently...
2
by: Pasacco | last post by:
dear I want to ask help on this problem. Array a is partitioned into a0 and a1 in main(). Then a1 is partitioned into a2 and a3 in th_partition() function. And I think this problem is something...
1
by: Hasani \(remove nospam\) | last post by:
The way the system works is, you create a user control (ascx) that will be a template and must implement the interface IPageTemplate. You then create one or more user controls (ascx) that implement...
4
by: serge calderara | last post by:
Dear all, I need to build a web application which collects data from an SQL server database. SQL server database tables fields can be dynamically created or extended depending on my customer...
4
by: ashmangat | last post by:
Hey I am new, but I don't have time to intruduce myself yet. I am intro to C++ and this is a programme I have to write. all the direction are here, It will be very nice of someone to figure this...
23
by: vinod.bhavnani | last post by:
Hello all, I need desperate help Here is the problem: My problem today is with multidimensional arrays. Lets say i have an array A this is a 4 dimensional static array.
18
by: Angus | last post by:
Hello We have a lot of C++ code. And we need to now create a library which can be used from C and C++. Given that we have a lot of C++ code using classes how can we 'hide' the fact that it is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.