473,503 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resizing frames with firefox

Hi all,

I'm trying to fix some javascript code to make it work also with
firefox.
I have the following function in a href link in a frame used to make
another frame ("uno") visible or invisible.

--- start here --
function resizeMenu() {
var stretto = '0%,100%';
var largo = '20%,80%';
if ( window.parent.uno.cols == largo ) {
window.parent.uno.cols=stretto;
} else {
window.parent.uno.cols=largo;
}
document.location.reload();
}
--- end here ---

This works with MSIE, but doesn't with firefox.

I read a lot over the internet, but didn't find anything useful to make
the function also works for firefox.

Note that Firefox console tells me:

"Errore: window.parent.uno has no properties"

But I don't know what to do to fix this.

Can anybody help me please?

Thank you,
Gianluca

Jan 15 '07 #1
5 7307
jeanor72 wrote:
if ( window.parent.uno.cols == largo ) {
window.parent.uno.cols=stretto;
} else {
Note that Firefox console tells me:

"Errore: window.parent.uno has no properties"
Use e.g.
var frameSet = parent.getElementById('uno');
if (frameSet != null) {
if (frameSet.cols == largo) {
frameSet.cols = = stretto;
}
else {
frameSet.cols = largo;
}
}
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 15 '07 #2
ASM
jeanor72 a écrit :
Hi all,

I'm trying to fix some javascript code to make it work also with
firefox.
I have the following function in a href link in a frame used to make
another frame ("uno") visible or invisible.

--- start here --
function resizeMenu() {
var stretto = '0%,100%';
var largo = '20%,80%';
if ( window.parent.uno.cols == largo ) {
window.parent.uno.cols=stretto;
} else {
window.parent.uno.cols=largo;
}
document.location.reload();
}
--- end here ---

This works with MSIE, but doesn't with firefox.
This would work everywhere (except NC4 IE4)

<html>
<script type="text/javascript">
function resizeMenu(sinistra,destra)
{
var attr = sinistra+'‰,'+destra+'‰';
document.getElementById("general").setAttribute('c ols',attr);;
}
</script>
<frameset id="general" cols="20%,80%">
<frame id="leftFrame" src="menu.htm">
<frame id="rightFrame" noresize scrolling="no" src="frame_a.htm">
</frameset>
</html>

file 'frame_a.htm' :

<html>
<a href="#" onclick="top.resizeMenu(0,100);return false;">hide menu</a>
<a href="#" onclick="top.resizeMenu(20,80);return false;">show menu</a>
</html>
Note that Firefox console tells me:

"Errore: window.parent.uno has no properties"
or you didn't give 'uno' as *name* for your frameset
or frame 'uno' isn't in parent's frame where you call your function
or FF doesn't like direct JS commands about its frames

I vote for case 1 (you did give an id instead a name to your frameset)

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 15 '07 #3
Hi Martin,

thank you for your answer.
Use e.g.
var frameSet = parent.getElementById('uno');
I tried this. It doesn't work and firefox console says:

"Errore: parent.getElementById is not a function".

Note that this way doesn't work even with msie.

Gianluca

Jan 15 '07 #4
jeanor72 wrote:
"Errore: parent.getElementById is not a function".
My bad, should of course be
var frameSet = parent.document.getElementById('uno');

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 15 '07 #5

Martin Honnen wrote:
My bad, should of course be
var frameSet = parent.document.getElementById('uno');
It works!

Thank you very very much!
Thanks also to ASM.
Your help has been very appreciated.

Gianluca

Jan 15 '07 #6

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

Similar topics

1
2817
by: Bill H | last post by:
I run a dbms application that interfaces with the web. This module creates a frames page with two frames ('main' and 'mwinfoframe'). All communication with the dbms is routed through the...
25
43184
by: Steal | last post by:
Hi at all I try to validate this page using the link: http://validator.w3.org/ but it return that this is not a valid HTML 4.01 page please where is it error? Steil <!DOCTYPE HTML PUBLIC...
5
16552
by: Dfenestr8 | last post by:
Hi. I'm designing a site, and I'm trying find a way of browsing it without using frames, so I can test the <noframes> </noframes> tags. I use a linux mandrake 10 system, with KDE 3.2. Is there...
1
2768
by: Keimo Repo | last post by:
Hello I would need some advice, even just speculations... A customer of ours insists on a couple of customer specific design features for our existing multi-customer web application: - A...
25
2434
by: Lars Eighner | last post by:
Remember the "Get a better browser!" messages that you used to run into when people thought frames were cool? Well, there is a new version of it. It's called 406 - Not Acceptable! -- Lars...
1
6735
by: troytabor | last post by:
I was having an issue at www.logolounge.com where the form in the bottom frame was no longer accessible through javascript in FireFox 1.5.0.8. I found the solution and wanted to share it. The...
4
2533
by: enceladus311 | last post by:
I've read through a number of links that discuss various methods of resizing a div; however, nothing seems to work correctly for me. The basic idea is that I would like to implement is a panel...
9
5267
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
2
1235
by: Xu, Qian | last post by:
Hello All JS-Experts, Is it possible to access 3rd-frames in Firefox or MSIE? I would like to write a html-based test framework. There are two frames. One is the test console and the other is a...
0
7199
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
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7273
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,...
0
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.