Click here to Skip to main content
15,923,376 members
Home / Discussions / Web Development
   

Web Development

 
QuestionException Handling Pin
ZeroSaine30-May-06 22:02
ZeroSaine30-May-06 22:02 
AnswerRe: Exception Handling Pin
Paddy Boyd31-May-06 0:14
Paddy Boyd31-May-06 0:14 
QuestionCurrent Culture Misunderstood Pin
huguesgauthier30-May-06 14:02
huguesgauthier30-May-06 14:02 
AnswerRe: Current Culture Misunderstood Pin
minhpc_bk30-May-06 15:40
minhpc_bk30-May-06 15:40 
GeneralRe: Current Culture Misunderstood Pin
huguesgauthier31-May-06 1:46
huguesgauthier31-May-06 1:46 
GeneralRe: Current Culture Misunderstood Pin
huguesgauthier31-May-06 4:52
huguesgauthier31-May-06 4:52 
GeneralRe: Current Culture Misunderstood Pin
minhpc_bk31-May-06 15:36
minhpc_bk31-May-06 15:36 
Questionlittle problem changing css class with javascript Pin
jszpila30-May-06 5:39
jszpila30-May-06 5:39 
Hello everyone,
I have a table set up to look like a box with 4 tabs. There are two classes of tabs, tabactive and tabinactive. tabactive has a white background, black border on the top, left, and right, and a white border on the bottom. tabinactive has a gray background, and a black border on all sides. The problem I'm having is that in Firefox when I click the link that activates the javascript function to change the class of the table cell/tab, the background color changes correctly but the bottom border change doesn't always stick. I'll get tabactive tabs with black bottom borders, and tabinactive cells with white bottom borders - everything else works fine. Oddly enough, this only seems to happen for the last 2 cells/tabs (see HTML below).

Here's my CSS:
.tabactive
{
border: solid 1px black;
border-bottom: solid 1px white;
background-color: #FFFFFF;
text-align: center;
padding: 0px;
margin: 0px;
}

.tabinactive
{
border: solid 1px black;
border-bottom: solid 1px black;
background-color: #CCCCCC;
text-align: center;
padding: 0px;
margin: 0px;
}</pre>


Here's my javascript:
/* set visibility of divs and change bg color of tabs */
function TabClick(LinkName)
{
for (var x = 1; x < 5; x++) //only allows for 4 tabs right now
{
TabID = "Tab" + x //assign names w/ increment that match elements
DivID = "Div" + x //i.e. Tab1, Div2, etc

Tab = document.getElementById(TabID) //grab elements
Div = document.getElementById(DivID)

if (TabID != LinkName) //set style and vis of unselected tabs + divs
{
Tab.className = "tabinactive"
Div.style.visibility = "collapse"
Div.style.display = "none"
}
else //set style and vis of selected tabs + divs
{
Tab.className = "tabactive"
Div.style.visibility = "visible"
Div.style.display = ''
}//end else
}//end for
}//end function


Here's my HTML (note that this happens almost exclusively on Tab3 and Tab4):
<table>
<tr>
<td class="tabactive" id="Tab1"><a href="#" onclick="TabClick('Tab1')">Tab1</a></td>
<td class="tabinactive" id="Tab2"><a href="#" onclick="TabClick('Tab2')">Tab2</a></td>
<td class="tabinactive" id="Tab3"><a href="#" onclick="TabClick('Tab3')">Tab3</a></td>
<td class="tabinactive" id="Tab4"><a href="#" onclick="TabClick('Tab4')">Tab4</a></td>
</tr>
<tr>
<td colspan="4">
<DIV ID="Div1" style="visibility: visible;">This is Div1.</div>
<DIV ID="Div2" style="visibility: hidden;">This is Div2.</div>
<DIV ID="Div3" style="visibility: hidden;">This is Div3.</div>
<DIV ID="Div4" style="visibility: hidden;">This is Div4.</div>
</td>
</tr>
</table>

Any ideas? It's a pretty minor problem so it's no big deal. But the minor problems are the ones that drive me nuts. Thanks in advance for any help!

-------------------
abort, retry, fail?
QuestionPAC Files on gateways Pin
mkjonga30-May-06 1:59
mkjonga30-May-06 1:59 
QuestionMicrosoft Content Management Server 2002 Pin
Kanjinghat30-May-06 1:57
Kanjinghat30-May-06 1:57 
AnswerRe: Microsoft Content Management Server 2002 Pin
minhpc_bk30-May-06 15:43
minhpc_bk30-May-06 15:43 
GeneralRe: Microsoft Content Management Server 2002 Pin
Kanjinghat30-May-06 18:19
Kanjinghat30-May-06 18:19 
AnswerRe: coloring row in gridview... using RGB method Pin
Lexa198331-May-06 5:59
Lexa198331-May-06 5:59 
Questionregarding Webserver Pin
srinivasaRaoS29-May-06 23:56
srinivasaRaoS29-May-06 23:56 
QuestionWebservices in Dotnet Pin
srinivasaRaoS29-May-06 23:52
srinivasaRaoS29-May-06 23:52 
Questionneed help on search engine Pin
bonaza29-May-06 6:26
bonaza29-May-06 6:26 
QuestionLocalization using Perl or HTML [modified] Pin
srinivasaRaoS29-May-06 1:55
srinivasaRaoS29-May-06 1:55 
Questionembedding of asp and applets [modified] Pin
cnr36929-May-06 1:49
cnr36929-May-06 1:49 
Questionie and firefox onload event mismatch Pin
ritu432129-May-06 1:08
ritu432129-May-06 1:08 
QuestionIntegration of asp and applet Pin
cnr36929-May-06 0:24
cnr36929-May-06 0:24 
QuestionForums Help Pin
psychohans28-May-06 21:08
psychohans28-May-06 21:08 
AnswerRe: Forums Help Pin
Shog928-May-06 22:07
sitebuilderShog928-May-06 22:07 
QuestionCrystalReports Pin
aby.m.a28-May-06 20:40
aby.m.a28-May-06 20:40 
QuestionCSS problems [modified] Pin
Megan Forbes28-May-06 18:05
Megan Forbes28-May-06 18:05 
AnswerRe: CSS problems [modified] Pin
Guffa28-May-06 19:04
Guffa28-May-06 19:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.