isubeatle
07-19-2004, 11:53 AM
i have 3 frames and i'm using javascript to "hide" the top frame when a link is clicked on in the middle frame.
so here's what i have in my frameset
<script type="text/javascript">
var columntype=""
var defaultsetting=""
function getCurrentSetting(){
if (document.body)
return (document.body.cols)? document.body.cols : document.body.rows
}
function setframevalue(coltype, settingvalue){
if (coltype=="rows")
document.body.rows=settingvalue
else if (coltype=="cols")
document.body.cols=settingvalue
}
function resizeFrame(contractsetting){
if (getCurrentSetting()!=defaultsetting)
setframevalue(columntype, defaultsetting)
else
setframevalue(columntype, contractsetting)
}
function init(){
if (!document.all && !document.getElementById) return
if (document.body!=null){
columntype=(document.body.cols)? "cols" : "rows"
defaultsetting=(document.body.cols)? document.body.cols : document.body.rows
}
else
setTimeout("init()",100)
}
setTimeout("init()",100)
</script>
here is the link that i'm using in the middle frame
<a href="javascript: parent.resizeFrame('0,20,*')">link</a>
it's works in IE of course but won't work in Netscape, even Netscape 7.0. For some reason it refreshes the page instead of just adjusting the frames. can anyone help me?
thanks
so here's what i have in my frameset
<script type="text/javascript">
var columntype=""
var defaultsetting=""
function getCurrentSetting(){
if (document.body)
return (document.body.cols)? document.body.cols : document.body.rows
}
function setframevalue(coltype, settingvalue){
if (coltype=="rows")
document.body.rows=settingvalue
else if (coltype=="cols")
document.body.cols=settingvalue
}
function resizeFrame(contractsetting){
if (getCurrentSetting()!=defaultsetting)
setframevalue(columntype, defaultsetting)
else
setframevalue(columntype, contractsetting)
}
function init(){
if (!document.all && !document.getElementById) return
if (document.body!=null){
columntype=(document.body.cols)? "cols" : "rows"
defaultsetting=(document.body.cols)? document.body.cols : document.body.rows
}
else
setTimeout("init()",100)
}
setTimeout("init()",100)
</script>
here is the link that i'm using in the middle frame
<a href="javascript: parent.resizeFrame('0,20,*')">link</a>
it's works in IE of course but won't work in Netscape, even Netscape 7.0. For some reason it refreshes the page instead of just adjusting the frames. can anyone help me?
thanks