472,784 Members | 887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Border lines in hidden div bleed through into visible div

Jon
Hi all,

I am trying to create a page that contains a number of div elements,
with links on the left side of the page allowing the user to select
which div to display. Some of the pages contain tables with border
styles used to block off the columns and the headers, but not the
individual rows. The pages will be displayed using IE 5.5 and later
in the finished app. Now to the problem, which is a little awkward to
describe:

When I apply the styles to do these interior border lines in a div
that is not displayed by default, the borders (but not the table
contents) bleed through to the default div. Once each of the table
divs has been selected, its border lines are not visible in the other
divs. So, once the user views each of the tables once, he can
navigate through the div elements freely, with the table borders
displaying only when the table is selected. Maybe an example would
help...

(Note: I have been able to make the lines behave correctly by using
'display: none' in the default CSS class for the table elements and
then looping through the elements and changing the class to one
without 'display: none' in it when the user chooses to view the table,
but this is excessively slow when I have a number of large tables (10
seconds or so in some cases).)

Thanks for any help,

Jon

<!----------------START HTML-------------------->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<style type="text/css">
..menubackground {
position: absolute;
top: 0;
left: 0;
width: 140;
height: 100%;
background= #013571;
z-index: 1;
}

..datapagebackground {
color: white;
position: absolute;
top: 0;
left: 140;
height: 100%;
z-index: 1;
overflow: hidden;
background= #011B4E;
}

..menuitem {
color: white;
z-index: 1;
border-style: solid;
border-color: #013571;
cursor: hand;
}

..selectedmenuitem {
font-weight: bolder;
color: yellow;
border-style: inset;
z-index: 2;
}

..normaltext {
color: white;
}

..labeltext {
color: yellow;
font-weight: bolder;
}

..txt {
color: gray;
z-order: 3
}

..tabletxt {
color: white;
z-order: 3;
}

..RC_Y {
border-bottom:'2 white solid';
border-right: '2 white solid';
}

..RC_N {
border-bottom:'none';
border-right: 'none';
}

..RY_CN{
border-bottom:'2 white solid';
border-right: 'none';
}

..RN_CY{
border-bottom:'none';
border-right:'2 white solid';
}
</style>

<script language="JSCRIPT" type="text/javascript">

var MenuArray = new Array(0);

function MenuClick(clickeditem) {
/* Reset all buttons and pages */
if (MenuArray.length == 0)
LoadMenuArray();

for (var x=0; x<MenuArray.length; x++) {
document.getElementById(MenuArray[x]).className = "menuitem";
document.getElementById(MenuArray[x] +
"page").style.visibility = "hidden";
}

/* Highlight our new item */
clickeditem.className = "selectedmenuitem";

/* Show the appropriate div element */
var pageobj;
pageobj = document.getElementById(clickeditem.id + "page");
pageobj.style.width = getInsideWindowWidth() - 140;
pageobj.style.visibility = "visible";
}
function LoadMenuArray() {
var x;

/* Need to load all of the Menu elements to be processed later */

/* Clear out the current elements */
while (MenuArray.length > 0)
{
MenuArray.pop();
}

/* Load the new elements */
for (x=0; x<document.all.length; x++)
{
if (document.all[x].name == "menuelement")
MenuArray.push(document.all[x].id);
}
}
function getInsideWindowWidth() {
var isIE6CSS = (document.compatMode &&
document.compatMode.indexOf("CSS1") >= 0) ? true : false;

if (window.innerWidth) {
return window.innerWidth;
} else if (isIE6CSS) {
return document.body.parentElement.clientWidth;
} else if (document.body && document.body.clientWidth) {
return document.body.clientWidth;
}
return 0;
}

</script>

<title>Border Bleed Through Demo</title>
</head>

<body>
<div id="menuback" class="menubackground">
<div id="menugeneral" class="selectedmenuitem" name="menuelement"
align="center" onclick="MenuClick(this);">
General
</div>
<div>
 
</div>
<div id="menutable2" class="menuitem" name="menuelement"
align="center" onclick="MenuClick(this);">
Table 2
</div>
</div>

<div id="menugeneralpage" class="datapagebackground"
style="visibility:visible;">
<table width="100%" class="normaltext">
<col valign="top" align="left" width="100%">
<tr>
<td><span class="labeltext">The rest of this page should be
blank</span></td>
</tr>
</table>
</div>

<div id="menutable2page" class="datapagebackground"
style="visibility:hidden;">
<br>
<table width="100%" id="table2" border="0" style="border:'2 white
solid';" rules="cols">
<caption align="center" valign="bottom" class="labeltext">
<br>
Table 2
</caption>
<colgroup align="left" charoff="50">
<col align="left" width="43.20pt">
<col align="left" width="94.32pt">
<col align="left" width="78.48pt">
</colgroup>
<tbody valign="top">
<tr class="RC_N">
<td class="RC_Y"><span class="tabletxt">Testing</span></td>
<td class="RC_Y"><span class="tabletxt">Testing
1,2,3</span></td>
<td class="RY_CN"><span class="tabletxt">Testing
3,2,1</span></td>
</tr>
<tr class="RC_N">
<td class="RN_CY"><span class="tabletxt">1</span></td>
<td class="RN_CY"><span class="tabletxt">test1a</span></td>
<td class="RC_N"><span class="tabletxt">test1b</span></td>
</tr>
<tr class="RC_N">
<td class="RN_CY"><span class="tabletxt">2</span></td>
<td class="RN_CY"><span class="tabletxt">test2a</span></td>
<td class="RC_N"><span class="tabletxt">test2b</span></td>
</tr>
<tr class="RY_CN">
<td class="RN_CY"><span class="tabletxt">3</span></td>
<td class="RN_CY"><span class="tabletxt">test3a</span></td>
<td class="RC_N"><span class="tabletxt">test3b</span></td>
</tr>
</tbody>
</table>
<br>
</div>
</body>
</html>
Jul 23 '05 #1
2 5239
the reason why its slow is coz you're making it to unnecessary work
it has to go and chekc through every item in the array everytime...

instead, set a global variable to hold the current menu item

and when you click the next menu item, use the variable to close the current
one, then just open the new one and set it as the variable again...

see what i mean?

just tell ur script which menu item it must close the next time, that's all,
then it don't gotta crawl through an array of menu items and hide when
they're prolly already hidden

cheers :0)
"Jon" <go*********@mail.com> wrote in message
news:4f**************************@posting.google.c om...
Hi all,

I am trying to create a page that contains a number of div elements,
with links on the left side of the page allowing the user to select
which div to display. Some of the pages contain tables with border
styles used to block off the columns and the headers, but not the
individual rows. The pages will be displayed using IE 5.5 and later
in the finished app. Now to the problem, which is a little awkward to
describe:

When I apply the styles to do these interior border lines in a div
that is not displayed by default, the borders (but not the table
contents) bleed through to the default div. Once each of the table
divs has been selected, its border lines are not visible in the other
divs. So, once the user views each of the tables once, he can
navigate through the div elements freely, with the table borders
displaying only when the table is selected. Maybe an example would
help...

(Note: I have been able to make the lines behave correctly by using
'display: none' in the default CSS class for the table elements and
then looping through the elements and changing the class to one
without 'display: none' in it when the user chooses to view the table,
but this is excessively slow when I have a number of large tables (10
seconds or so in some cases).)

Thanks for any help,

Jon

<!----------------START HTML-------------------->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<style type="text/css">
.menubackground {
position: absolute;
top: 0;
left: 0;
width: 140;
height: 100%;
background= #013571;
z-index: 1;
}

.datapagebackground {
color: white;
position: absolute;
top: 0;
left: 140;
height: 100%;
z-index: 1;
overflow: hidden;
background= #011B4E;
}

.menuitem {
color: white;
z-index: 1;
border-style: solid;
border-color: #013571;
cursor: hand;
}

.selectedmenuitem {
font-weight: bolder;
color: yellow;
border-style: inset;
z-index: 2;
}

.normaltext {
color: white;
}

.labeltext {
color: yellow;
font-weight: bolder;
}

.txt {
color: gray;
z-order: 3
}

.tabletxt {
color: white;
z-order: 3;
}

.RC_Y {
border-bottom:'2 white solid';
border-right: '2 white solid';
}

.RC_N {
border-bottom:'none';
border-right: 'none';
}

.RY_CN{
border-bottom:'2 white solid';
border-right: 'none';
}

.RN_CY{
border-bottom:'none';
border-right:'2 white solid';
}
</style>

<script language="JSCRIPT" type="text/javascript">

var MenuArray = new Array(0);

function MenuClick(clickeditem) {
/* Reset all buttons and pages */
if (MenuArray.length == 0)
LoadMenuArray();

for (var x=0; x<MenuArray.length; x++) {
document.getElementById(MenuArray[x]).className = "menuitem";
document.getElementById(MenuArray[x] +
"page").style.visibility = "hidden";
}

/* Highlight our new item */
clickeditem.className = "selectedmenuitem";

/* Show the appropriate div element */
var pageobj;
pageobj = document.getElementById(clickeditem.id + "page");
pageobj.style.width = getInsideWindowWidth() - 140;
pageobj.style.visibility = "visible";
}
function LoadMenuArray() {
var x;

/* Need to load all of the Menu elements to be processed later */

/* Clear out the current elements */
while (MenuArray.length > 0)
{
MenuArray.pop();
}

/* Load the new elements */
for (x=0; x<document.all.length; x++)
{
if (document.all[x].name == "menuelement")
MenuArray.push(document.all[x].id);
}
}
function getInsideWindowWidth() {
var isIE6CSS = (document.compatMode &&
document.compatMode.indexOf("CSS1") >= 0) ? true : false;

if (window.innerWidth) {
return window.innerWidth;
} else if (isIE6CSS) {
return document.body.parentElement.clientWidth;
} else if (document.body && document.body.clientWidth) {
return document.body.clientWidth;
}
return 0;
}

</script>

<title>Border Bleed Through Demo</title>
</head>

<body>
<div id="menuback" class="menubackground">
<div id="menugeneral" class="selectedmenuitem" name="menuelement"
align="center" onclick="MenuClick(this);">
General
</div>
<div>
 
</div>
<div id="menutable2" class="menuitem" name="menuelement"
align="center" onclick="MenuClick(this);">
Table 2
</div>
</div>

<div id="menugeneralpage" class="datapagebackground"
style="visibility:visible;">
<table width="100%" class="normaltext">
<col valign="top" align="left" width="100%">
<tr>
<td><span class="labeltext">The rest of this page should be
blank</span></td>
</tr>
</table>
</div>

<div id="menutable2page" class="datapagebackground"
style="visibility:hidden;">
<br>
<table width="100%" id="table2" border="0" style="border:'2 white
solid';" rules="cols">
<caption align="center" valign="bottom" class="labeltext">
<br>
Table 2
</caption>
<colgroup align="left" charoff="50">
<col align="left" width="43.20pt">
<col align="left" width="94.32pt">
<col align="left" width="78.48pt">
</colgroup>
<tbody valign="top">
<tr class="RC_N">
<td class="RC_Y"><span class="tabletxt">Testing</span></td>
<td class="RC_Y"><span class="tabletxt">Testing
1,2,3</span></td>
<td class="RY_CN"><span class="tabletxt">Testing
3,2,1</span></td>
</tr>
<tr class="RC_N">
<td class="RN_CY"><span class="tabletxt">1</span></td>
<td class="RN_CY"><span class="tabletxt">test1a</span></td>
<td class="RC_N"><span class="tabletxt">test1b</span></td>
</tr>
<tr class="RC_N">
<td class="RN_CY"><span class="tabletxt">2</span></td>
<td class="RN_CY"><span class="tabletxt">test2a</span></td>
<td class="RC_N"><span class="tabletxt">test2b</span></td>
</tr>
<tr class="RY_CN">
<td class="RN_CY"><span class="tabletxt">3</span></td>
<td class="RN_CY"><span class="tabletxt">test3a</span></td>
<td class="RC_N"><span class="tabletxt">test3b</span></td>
</tr>
</tbody>
</table>
<br>
</div>
</body>
</html>

Jul 23 '05 #2
Jon
"Dominique" <ni****@webadstudio.com> wrote in message news:<c7**********@ctb-nnrp2.saix.net>...
the reason why its slow is coz you're making it to unnecessary work
it has to go and chekc through every item in the array everytime...

instead, set a global variable to hold the current menu item

and when you click the next menu item, use the variable to close the current
one, then just open the new one and set it as the variable again...

see what i mean?

just tell ur script which menu item it must close the next time, that's all,
then it don't gotta crawl through an array of menu items and hide when
they're prolly already hidden

cheers :0)


Dominique,

Thank you for the reply. I do see what you mean. The code is
certainly ineffecient, but if I make those changes, I still have the
problem of those internal table border lines bleeding through into the
div that is visible (at least until I've viewed the table and then
switched to another div). Try viewing the HTML that I posted, and
(hopefully) you will see what I mean. I would very much appreciate
any additional insights you can give me. I'm stumped. I'm pretty
sure that IE isn't handling this correctly, but even if it is, I don't
expect Microsoft to come riding to my rescue anytime soon.

Thanks again,

Jon
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: yurps | last post by:
Hello here is my html, if you click the missing image in the first column on the left, the div is shown, when clicked again the div disappears...but the bottom border disappears as well...Is there...
3
by: ireneatngs | last post by:
Hi, I have example html below which contains a couple of hidden divs. However, some of the table borders within these hidden divs are actually displayed when they should not be. In my...
1
by: Eric | last post by:
How come a user control on an ASPX page that has visible set to false causes blank lines? We have an ASPX page with many hidden user controls on it, where we make the one we need visible. If the...
31
by: jcrouse | last post by:
Is there a quick and easy way to change the color of a label controls border from the default black to white? Thank you, John
2
by: Asterbing | last post by:
Hi all. I'm trying and don't succeed to include an HTML page into another without any border nor visible scroll-bar. Even if I would like something which will work under Netscape too, at this...
17
by: michel.ank | last post by:
Hi, I'm using the class PrintLines and my last record of page aren't with the borders. Somebody can help me? Thanks,
0
by: eggsurplus | last post by:
<em>I just posted this in the wrong forum so sorry if anyone gets a dup!</em> I'm working on a slide down horizontal menu and I'm having issues getting the border around the submenu to display...
8
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml...
8
by: Zhang Weiwu | last post by:
hello. Is it possible to design CSS in the way that content in <inputare not visible in print out (a.k.a. value of <inputnot visible) while the border remain visible? trial: input {...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.