Solved

dynamic frameset properties

Posted on 2003-10-22
18
359 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to combine and minify CSS and JS files 5 17
Jquery-Javascript setAttribute function help 7 18
jQuery Scroll To Top 5 38
Access RV042 GUI / Browser Issues 25 48
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article discusses how to create an extensible mechanism for linked drop downs.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

856 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