Solved

dynamic frameset properties

Posted on 2003-10-22
18
356 Views
Last Modified: 2013-11-19
Can I change the properties of a frameset?
I want to add/remove the frameborder between frames and also turn the noresize property off and on.
0
Comment
Question by:kaller2
  • 7
  • 6
  • 5
18 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 9602577
try
framesetName.frameBorder='no'
framesetName.noResize='0'
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 9602582
probably noResize=true by the way
0
 
LVL 2

Author Comment

by:kaller2
ID: 9604774
Here's my code.
What lines should I add/change?

<html>
<head>
</head>
<frameset cols="40%,*" name="thetop" >
<frame src="left.html" name="theleft" />
<frame src="right.html" name="theright" />
</frameset>
</html>


<html>
<head>
<script language="javascript">
function dothis() {
// ?????
}
</script>
</head>
<body onload="javascript:dothis();" >
rightframe
</body>
</html>

<html>
<body>
leftframe
</body>
</html>
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 9605934
I assume the html is either the left or right.html

try

top.framesetName.frameBorder='no'
top.framesetName.noResize=true

instead of the // ??????????
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 9605942
and that would of course be


top.theLeft.frameBorder='no'
top.theLeft.noResize=true

but I am not sure that will work.
0
 
LVL 3

Expert Comment

by:makc
ID: 9608509
good one.
though, personally me could not reference left frame as top.theleft...

in frameset, specify ..." name="theleft" id="brotha" />

in right frame, replace // ????? with

myBrotha = top.document.getElementById("brotha")
myBrotha.noResize=true

that worx. hovewer, whatever have been said about .frameBorder property, available on both <frameset> and <frame> elements, setting it from script works weird (does not work as expected, but affects frame border in some strange way).
0
 
LVL 2

Author Comment

by:kaller2
ID: 9608883
Yes I actually managed to get noresize to respond, but thats because its simply talking to another frame.  The problem is changing the FRAMESET properties.  Well I cant get it to behave.  The body.cols responds ok so I can hide a frame but it would be nice to be able to toggle the frameborder.  

I found a reference on the web that suggests that you have to remove all the borders from touching frames to remove a border.  I am going to try some experiments along these lines.

0
 
LVL 3

Expert Comment

by:makc
ID: 9609140
It looks to me that does not work either. Neither .frameBorder=true, nor .setAttribute("frameborder","no",0) do what supposed to, no matter if you apply it to <frameset> only, or to frames too :(
0
 
LVL 3

Expert Comment

by:makc
ID: 9609154
I suppose using top.document.body.innerHTML would be a little bit freaky workaround :)
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 2

Author Comment

by:kaller2
ID: 9611371
I looked up w3schools DOM reference and they list frameborders as "returns value" rather than "sets value".  So maybe its readonly.  Setting the frameborder in the frames html itself works fine, it is just not available after that it would seem.  

Another funny is that setting cols 100%,* creates a hidden frame, but *,100% leaves the cursed frameborder on the left margin.

I thought about hacking it by having a page break the frame and en-frame itself again.
I thought that maybe even using document.writes on the page could achieve all that.  What did you have in mind with top.document.body.innerHTML?

Are you talking about dynamically modifying the HTML of the frameset?  That sounds cool, but my javascript is still a bit shaky - can you give me a few more hints?
0
 
LVL 3

Accepted Solution

by:
makc earned 225 total points
ID: 9615856
forget innerHTML - it does not work either. Copy and paste html below into your right frame:

<html>
<head>
<script language="javascript">
function dothis() {
// set attribute - this will not yet make the trick
top.document.body.setAttribute("frameborder", "no", 0)
// copy frameset (with frameborder set to "no")
var smth = top.document.body.cloneNode(true)
// add copy to DOM
top.document.body.parentElement.appendChild(smth)
// remove old frameset, so it will have no choise
// but to display copy we made
top.document.body.parentElement.removeChild(top.document.body)

}
</script>
</head>
<body>
rightframe
<button onclick="dothis()">kill god damn frameborder</button>
</body>
</html>

P.S.: I am stinky smart ass.
0
 
LVL 3

Expert Comment

by:makc
ID: 9653838
so, am I giong to have my points?
my code worx perfectly on IE 6, come on!
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 9655628
Makc: Please be a little more professional
Thanks

Michel
0
 
LVL 2

Author Comment

by:kaller2
ID: 9656618
My award posting stick before, that is why no points.  Hopefully you have stinky points now ;)
0
 
LVL 3

Expert Comment

by:makc
ID: 9665939
2mplungjan: sorry, that's not my intention. so, i am affraid, you going to have nothing to thank me for :(
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 9665989
Hmm. It was just a suggstion

http://www.experts-exchange.com/memberAgreement.jsp

"Posting, transmitting or linking to profane language, descriptions of situations or scenarios considered, in the opinion of Experts Exchange, inappropriate for the Experts Exchange membership."

"Experts Exchange provides its Services and Site to Members on the assumption that Members will act professionally and responsibly."

0
 
LVL 2

Author Comment

by:kaller2
ID: 9668617
Profane:  Not sacred or holy; not possessing peculiar sanctity; unconsecrated; hence, relating to matters other than sacred; secular; -- opposed to sacred, religious, or inspired; as, a profane place. Profane authors." I. Disraeli.

"Pro phanus"  before the temple as used by the romans to describe those who came to the temple without having been initiated according to the religious rites.  

So profane language would anything irreligious.  Accordingly what he said wasn't profane.

However smart ass is a reference to a donkey, thats probably OK, but the unfortunate conjunction with "stinky" tends to lend it posterior connotations and that might be unsettling to refined persons (religious or otherwise) people who might not care for allusions to the nether regions.

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 9669016
And merriam webster:
Main Entry: 1pro·fane
Pronunciation: prO-'fAn, pr&-
Function: transitive verb
Inflected Form(s): pro·faned; pro·fan·ing
Etymology: Middle English prophanen, from Latin profanare, from profanus
Date: 14th century
1 : to treat (something sacred) with abuse, irreverence, or contempt : DESECRATE
2 : to debase by a wrong, unworthy, or vulgar use

Note the brackets around somethins sacred, note the (2) and note the word "from"

Please note, people who come after, that we are only pulling makc's leg
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now