473,386 Members | 1,712 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,386 software developers and data experts.

make a frame invisible

Hi

I have hunted around for this one but been unable to find any definitive
answer.

I have a simple frameset with one frame above another. by clicking a
checkbox or some such in the lower frame the user can choose whether to have
the upper frame displayed or not.

I have tried frames["upper"].style.display="none" which looked right
according to the CSS spec but didn't work for me.

I don't want to have to reload the page without a frameset; I want to keep
the frameset in place but the lower frame fills the window and the user
cannot see or navigate to the upper frame. This should work in recent
versions of popular browsers (mandatory IE6 and Firefox)

Can this be done?

TIA

Andy
Jul 23 '05 #1
4 5580
Just off the top of the head, can you change the frame size of the
frame you want to hide, to be 0 (or make the other frame 100%,
whatever)? Can the "Rows" attribute of the Frameset tag be modified to
do this in DHTML? I would go this route.

Jul 23 '05 #2
Andy Fish wrote:
Hi

I have hunted around for this one but been unable to find any definitive answer.

I have a simple frameset with one frame above another. by clicking a
checkbox or some such in the lower frame the user can choose whether to have the upper frame displayed or not.

I have tried frames["upper"].style.display="none" which looked right
according to the CSS spec but didn't work for me.

I don't want to have to reload the page without a frameset; I want to keep the frameset in place but the lower frame fills the window and the user cannot see or navigate to the upper frame. This should work in recent versions of popular browsers (mandatory IE6 and Firefox)

Can this be done?

TIA

Andy


Remembered this from years past but, no idea how cross-browser it is.
Check it out if you like...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/str***ict.dtd">
<html>
<head>
<title>untitled</title>
<style type="text/css">
</style>
<script type="text/javascript">

function upperF()
{
return [
'<html><head></head>',
'<body style="background:coral;"',
'><h2>upper</h2></body>',
'</html>'].join('');
}
function lowerF()
{
return [
'<html><head></head>',
'<body style="background:moccasin;"',
'><h2>lower</h2><input type="checkbox" ',
'onclick="top.toggleUpper(this.checked)">',
' <span id="hs">hide</span> upper',
'</body></html>'].join('');
}

function toggleUpper(bWhich)
{
document.body.rows =
(bWhich) ? '0,*' : '20%,*';
lower.document.getElementById('hs').innerHTML =
(bWhich) ? 'show' : 'hide';
}

</script>
</head>
<frameset rows="20%,*">
<frame name="upper" src="javascript:top.upperF()">
<frame name="lower" src="javascript:top.lowerF()">
</frameset>
</html>

The relevant code is in toggleUpper, the rest is just for putting
everything in one file. hth

Jul 23 '05 #3
I just dynamically changed my frameset size, hope this helps you, I did
it this way:
parent.document.body.rows="100%,*"

This hid my bottom frame. It looks like the bottom 50% of my
screen is just whitespace.

Jul 23 '05 #4
<br*************@glic.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I just dynamically changed my frameset size, hope this helps you, I did
it this way:
parent.document.body.rows="100%,*"

This hid my bottom frame. It looks like the bottom 50% of my
screen is just whitespace.


Thanks Bruce (and RobB for the other reply)

I was able to get about 90% most of the way with DHTML, but I came unstuck a
bit with the borders. I need to have the frame border visible and resizable
when in 2-frame mode, and to look as if there is no frame there at all (i.e.
no frame borders) when in 1-frame mode.

After a lot of faffind about, I wasn't able to get something that looked
seamless in different browsers, so I have decided to reload the frameset
when when switching modes. At least I know this will be browser-independent.

Andy

Jul 23 '05 #5

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

Similar topics

5
by: Leon | last post by:
Hi, Could you give me some suggestions or ideas for the loading speed difference between using one single frame for a web page and not using frame for this page? Thank you very much.
3
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is...
0
by: tham | last post by:
hi, my mdi app has the concept of "Project File" which is the default document. i wanna leverage MFC doc/view architecture but i dont wanna create a CMDIChildFrame for the project file... how...
3
by: Richard | last post by:
After printing a userlist to a Datagrid i want some names not to be shown. I want to know how i can make a entire datagrid row invisible. I suspect its something with the OnItemDatabound but i am...
6
by: Yves-Alain.Nicollet | last post by:
Hi. I have a frameset with 3 frames that look like a T, with the top frame containing buttons like a toolbar, the left frame usually containing a dynamic TOC and the right frame containing the...
2
by: Kevin | last post by:
I have a few frame controls on my form in my Windows Forms app. I have a Listbox that stretches over a few of the frame controls but is invisible until the user click a button. The problem is, when...
7
by: Nader | last post by:
It's easy to make the last row in a datagrid (filled with a table) invisible: datagridObject.Rows.Visible = false BUT if 'i' is not the last row then things go wrong. I even tried: for...
5
by: Hank Mishkoff | last post by:
Is there any way to use JavaScript to determine how much text will fit into a non-scrolling browser frame? I have a non-scrolling frame in which I want to insert some text. I know that the text...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.