dynamic frameset properties

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.
LVL 2
kaller2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
try
framesetName.frameBorder='no'
framesetName.noResize='0'
0
Michel PlungjanIT ExpertCommented:
probably noResize=true by the way
0
kaller2Author Commented:
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Michel PlungjanIT ExpertCommented:
I assume the html is either the left or right.html

try

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

instead of the // ??????????
0
Michel PlungjanIT ExpertCommented:
and that would of course be


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

but I am not sure that will work.
0
makcCommented:
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
kaller2Author Commented:
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
makcCommented:
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
makcCommented:
I suppose using top.document.body.innerHTML would be a little bit freaky workaround :)
0
kaller2Author Commented:
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
makcCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
makcCommented:
so, am I giong to have my points?
my code worx perfectly on IE 6, come on!
0
Michel PlungjanIT ExpertCommented:
Makc: Please be a little more professional
Thanks

Michel
0
kaller2Author Commented:
My award posting stick before, that is why no points.  Hopefully you have stinky points now ;)
0
makcCommented:
2mplungjan: sorry, that's not my intention. so, i am affraid, you going to have nothing to thank me for :(
0
Michel PlungjanIT ExpertCommented:
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
kaller2Author Commented:
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
Michel PlungjanIT ExpertCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.