473,729 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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">
..menubackgroun d {
position: absolute;
top: 0;
left: 0;
width: 140;
height: 100%;
background= #013571;
z-index: 1;
}

..datapagebackg round {
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;
}

..selectedmenui tem {
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="JSCRI PT" type="text/javascript">

var MenuArray = new Array(0);

function MenuClick(click editem) {
/* Reset all buttons and pages */
if (MenuArray.leng th == 0)
LoadMenuArray() ;

for (var x=0; x<MenuArray.len gth; x++) {
document.getEle mentById(MenuAr ray[x]).className = "menuitem";
document.getEle mentById(MenuAr ray[x] +
"page").style.v isibility = "hidden";
}

/* Highlight our new item */
clickeditem.cla ssName = "selectedmenuit em";

/* Show the appropriate div element */
var pageobj;
pageobj = document.getEle mentById(clicke ditem.id + "page");
pageobj.style.w idth = getInsideWindow Width() - 140;
pageobj.style.v isibility = "visible";
}
function LoadMenuArray() {
var x;

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

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

/* Load the new elements */
for (x=0; x<document.all. length; x++)
{
if (document.all[x].name == "menuelemen t")
MenuArray.push( document.all[x].id);
}
}
function getInsideWindow Width() {
var isIE6CSS = (document.compa tMode &&
document.compat Mode.indexOf("C SS1") >= 0) ? true : false;

if (window.innerWi dth) {
return window.innerWid th;
} else if (isIE6CSS) {
return document.body.p arentElement.cl ientWidth;
} else if (document.body && document.body.c lientWidth) {
return document.body.c lientWidth;
}
return 0;
}

</script>

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

<body>
<div id="menuback" class="menuback ground">
<div id="menugeneral " class="selected menuitem" name="menueleme nt"
align="center" onclick="MenuCl ick(this);">
General
</div>
<div>
 
</div>
<div id="menutable2 " class="menuitem " name="menueleme nt"
align="center" onclick="MenuCl ick(this);">
Table 2
</div>
</div>

<div id="menugeneral page" class="datapage background"
style="visibili ty:visible;">
<table width="100%" class="normalte xt">
<col valign="top" align="left" width="100%">
<tr>
<td><span class="labeltex t">The rest of this page should be
blank</span></td>
</tr>
</table>
</div>

<div id="menutable2p age" class="datapage background"
style="visibili ty:hidden;">
<br>
<table width="100%" id="table2" border="0" style="border:' 2 white
solid';" rules="cols">
<caption align="center" valign="bottom" class="labeltex t">
<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"><s pan class="tabletxt ">Testing</span></td>
<td class="RC_Y"><s pan 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"><s pan 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"><s pan 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"><s pan class="tabletxt ">test3b</span></td>
</tr>
</tbody>
</table>
<br>
</div>
</body>
</html>
Jul 23 '05 #1
2 5291
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*********@ma il.com> wrote in message
news:4f******** *************** ***@posting.goo gle.com...
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;
}

.datapagebackgr ound {
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;
}

.selectedmenuit em {
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="JSCRI PT" type="text/javascript">

var MenuArray = new Array(0);

function MenuClick(click editem) {
/* Reset all buttons and pages */
if (MenuArray.leng th == 0)
LoadMenuArray() ;

for (var x=0; x<MenuArray.len gth; x++) {
document.getEle mentById(MenuAr ray[x]).className = "menuitem";
document.getEle mentById(MenuAr ray[x] +
"page").style.v isibility = "hidden";
}

/* Highlight our new item */
clickeditem.cla ssName = "selectedmenuit em";

/* Show the appropriate div element */
var pageobj;
pageobj = document.getEle mentById(clicke ditem.id + "page");
pageobj.style.w idth = getInsideWindow Width() - 140;
pageobj.style.v isibility = "visible";
}
function LoadMenuArray() {
var x;

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

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

/* Load the new elements */
for (x=0; x<document.all. length; x++)
{
if (document.all[x].name == "menuelemen t")
MenuArray.push( document.all[x].id);
}
}
function getInsideWindow Width() {
var isIE6CSS = (document.compa tMode &&
document.compat Mode.indexOf("C SS1") >= 0) ? true : false;

if (window.innerWi dth) {
return window.innerWid th;
} else if (isIE6CSS) {
return document.body.p arentElement.cl ientWidth;
} else if (document.body && document.body.c lientWidth) {
return document.body.c lientWidth;
}
return 0;
}

</script>

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

<body>
<div id="menuback" class="menuback ground">
<div id="menugeneral " class="selected menuitem" name="menueleme nt"
align="center" onclick="MenuCl ick(this);">
General
</div>
<div>
 
</div>
<div id="menutable2 " class="menuitem " name="menueleme nt"
align="center" onclick="MenuCl ick(this);">
Table 2
</div>
</div>

<div id="menugeneral page" class="datapage background"
style="visibili ty:visible;">
<table width="100%" class="normalte xt">
<col valign="top" align="left" width="100%">
<tr>
<td><span class="labeltex t">The rest of this page should be
blank</span></td>
</tr>
</table>
</div>

<div id="menutable2p age" class="datapage background"
style="visibili ty:hidden;">
<br>
<table width="100%" id="table2" border="0" style="border:' 2 white
solid';" rules="cols">
<caption align="center" valign="bottom" class="labeltex t">
<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"><s pan class="tabletxt ">Testing</span></td>
<td class="RC_Y"><s pan 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"><s pan 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"><s pan 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"><s pan class="tabletxt ">test3b</span></td>
</tr>
</tbody>
</table>
<br>
</div>
</body>
</html>

Jul 23 '05 #2
Jon
"Dominique" <ni****@webadst udio.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
2733
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 anyway to stop this...??? <HTML> <HEAD> <title>Conform Inbox</title> <meta content="False" name="vs_snapToGrid">
3
1068
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 example, I have comments indicating that if I remove the 'border-collapse' attribute for two of the tables within the hidden divs, my problem is fixed.
1
1287
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 visible control is positioned last on the ASPX page it will be set lower on the page then when the top one is made visible. Seems like there is a bug in hidden user controls where they cause a blank line. Any suggestions? Thanks.
31
7237
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
5359
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 point, my tests are made under IE6 with the following HTML files, using <object>, <embed> and <iframe> : The main HTML page : ******************** <html> <head>
17
2526
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
2607
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 correctly. I'm trying to get a 1px border on the left and right side and an image on the bottom for rounded corners. I finally got it to display correctly in FF but now the right border is 2px instead of 1px in IE because of the
8
11510
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 file. each control has a border with another style, and each border has a unique path inside of it. I need to dynamically add these content controls using c# at runtime and am having trouble referencing the styles and adding the path into the...
8
3626
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 { border: thin solid black;
0
8917
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.