473,944 Members | 4,585 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Arranging Div Layers

I have a set of 10 div layers on a page that each contain dynamic
content pulled from a database so the size of the div layers is not
static. Each layer can be viewed or hidden by checking checkboxes at
the top of the page. The problem I'm having is that if the user wants
to view only div layers 8-10, I have a lot of dead space in the page
where div layers 1-7 are on the page but not visible in the browser.
How do I arrange these div layers so that each one opens at the top of
the page and each subsequent one is opened beneath the other so I don't
have any white space between the div layers? Thanks.

Jan 20 '06 #1
5 2673
<ev*******@gmai l.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I have a set of 10 div layers on a page that each contain dynamic
content pulled from a database so the size of the div layers is not
static. Each layer can be viewed or hidden by checking checkboxes at
the top of the page. The problem I'm having is that if the user wants
to view only div layers 8-10, I have a lot of dead space in the page
where div layers 1-7 are on the page but not visible in the browser.
How do I arrange these div layers so that each one opens at the top of
the page and each subsequent one is opened beneath the other so I don't
have any white space between the div layers? Thanks.


Sounds like a CSS question (for another newsgroup).

Are you using "display:no ne" which reserves the space?

Try "visibility:hid den" which doesn't.
Jan 20 '06 #2
"McKirahan" <Ne**@McKirahan .com> wrote in message
news:pN******** ************@co mcast.com...
<ev*******@gmai l.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I have a set of 10 div layers on a page that each contain dynamic
content pulled from a database so the size of the div layers is not
static. Each layer can be viewed or hidden by checking checkboxes at
the top of the page. The problem I'm having is that if the user wants
to view only div layers 8-10, I have a lot of dead space in the page
where div layers 1-7 are on the page but not visible in the browser.
How do I arrange these div layers so that each one opens at the top of
the page and each subsequent one is opened beneath the other so I don't
have any white space between the div layers? Thanks.


Sounds like a CSS question (for another newsgroup).

Are you using "display:no ne" which reserves the space?

Try "visibility:hid den" which doesn't.


Like this:

<html>
<head>
<title>showhide .htm</title>
<script type="text/javascript">
function Disp() {
var disp = document.getEle mentById("div1" ).style.display ;
disp = (disp == "none") ? "block" : "none";
document.getEle mentById("div1" ).style.display = disp;
}
function Visi() {
var visi = document.getEle mentById("div2" ).style.visibil ity;
visi = (visi == "hidden") ? "visible" : "hidden";
document.getEle mentById("div2" ).style.visibil ity = visi;
}
</script>
</head>
<body>
<hr>
<div id="div1" style="display: block"> 1 </div>
<hr>
<div id="div2" style="visibili ty:visible"> 2 </div>
<hr>
<input type="button" value="Show/Hide 1" onclick="Disp() ">
<input type="button" value="Show/Hide 2" onclick="Visi() ">
</body>
</html>
Jan 20 '06 #3
ev*******@gmail .com wrote:
How do I arrange these div layers so that each one opens at the top of
the page and each subsequent one is opened beneath the other so I don't
have any white space between the div layers?


First - don't make them "layers".

Second - set the top and bottom margins of each to 0.

No need for JavaScript at all.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jan 20 '06 #4
I can't seem to get it right. I'm working on a combination of
suggestions here. It's still reserving that space for the hidden div
sections: http://216.204.149.105/companies/company_profile.asp

function hideLayer(which Layer)
{
document.getEle mentById(whichL ayer).style.dis play = 'none';
var strshowhide=0;
frmPanelStatus. location.href=" panelstatus.asp ?showhide=" + strshowhide
+ "&whichLaye r=" + whichLayer;
}

function showLayer(which Layer)
{
document.getEle mentById(whichL ayer).style.dis play = 'inline';
var strshowhide=1;
frmPanelStatus. location.href=" panelstatus.asp ?showhide=" + strshowhide
+ "&whichLaye r=" + whichLayer;
}
<div id="CompanyBoar d"
<% If strshowhide = 0 Then
Response.Write "class=""divNot Visible"""
Else
Response.Write "class=""divVis ible"""
End If
%>>

<a href="javascrip t:showLayer('Co mpanyBoard');"> Show</a>/<a
href="javascrip t:hideLayer('Co mpanyBoard');"> Hide</a>

</div>

style.css page:

..divNotVisible
{
display: none;
/* visibility: hidden; */
}
..divVisible
{
display: inline; */
/* visibility: visible; */
}

Jan 20 '06 #5
I'm an idiot...I had <p>&nbsp;</p> content outside of my div tags that
was occupying the hidden space. Thanks everyone for your help.

Jan 20 '06 #6

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

Similar topics

1
2824
by: Lizzy | last post by:
I have an internet application which has a progress bar show whenever the customer is requesting data from the server. This progress bar is coded to work in both Netscape 4.75 and above and IE 5.0 and above. The progress bar code is written in javascript in an external js file (progressbar.js). The web screen is in a seperate jsp file (Registration.jsp). The problem I'm having is that the progress bar is not showing in Netscape 4.75 on a...
6
6853
by: David List | last post by:
I'm having a problem using different properties of the document object in the example javascripts in my textbook with browsers that identify themselves as using the Mozilla engine. One example of these problems is using document.layers. I have Google'd for examples of how to use the document object specifically with Mozilla, but I cannot find anything that explains why my problems occur. Could anyone here see through the included example...
8
11110
by: Freek te Water | last post by:
Hi, Hope no-one is offended by my probably noob question... Context: I have a web page design, which always centres in the middle of the screen (using a 100%*100% HTML-table). Now I also use layers, that get visible when something is clicked. All works fine. Problem:
4
3817
by: ashkaan57 | last post by:
Hi, I am using the following code to show/hide part of an html page. It works in Netscape and Firefox but dies in IE: "Error: document.layers is null or not an object" <style> ..noshow { display: none; } ..menu {
3
2219
by: Ironside | last post by:
Can someone give me a basic script example for arranging thumbnails on a page. I have always put them in tables that CSS is obviously better. Also, I like to put writing underneath the thumbnails as well, how do I get around that? Thanks in advance
2
1864
by: michael | last post by:
Hi All, I'm trying to achieve an "ideal" of arranging the thumbnails on one of my sites using only styles and divs, rather than a table. I'm well practised with Divs etc, but a solution that works properly eludes me here. In particular there are two problems.. 1). There are graphical glitches in both IE and Firefox/opera, some of the time. 2). The thumbnails are not centrally aligned and even wrapping a div
5
2388
by: Burt | last post by:
There's an architect at my 200 person company that advocates having many layers in all my C# apps. He wants web services, use case handlers, facade layers, data gateways, etc. When I ask why all this complexity is necessary, he gives me what if scenarios: "What if you ever want to access the business logic with another front end?", for example. These are typical "intranet apps"...one or more screens selecting and updating rows in a...
1
5591
by: Grimm | last post by:
I am developing an internalk inteface that integrates alot of seperate tools into one interface. The current version uses one Iframe inside a div layer for positioning. Currently the seperate web tools do not have the ability to stay active. As you switch from tool to tool the previous information is lost unless you use a Back button. I need to place multiple div layers with I frames in them that can be shown or hidden based on selection. The...
2
1137
by: Jerry Spence1 | last post by:
I'm just wondering if there are any clever mathematicians out there. My VB2005 program consists of a number of panels on a form. Here's the rules: The number of panels will be variable The screen size is fixed You can change the size of each panel, but it's aspect ratio must always be 1.3:1 (each panel hols a photo) and each panel should end up the same size.
0
9971
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
11134
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
10671
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
9868
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8234
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7396
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
6313
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4918
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
4516
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.