JavaScript.CoolDev.Com Support Forums

Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Netscape Navigator 4 resize problem

 
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu
Author Message
camner



Joined: 05 Jun 2003
Posts: 21

PostPosted: Sun Jun 15, 2003 12:37 am    Post subject: Netscape Navigator 4 resize problem Reply with quote

There is a well-known problem with Netscape Navigator 4.x: when a window is resized, all hell breaks loose (layers are not placed correctly). There are many javascript workarounds around the Net. They all involve having javascript reload the page when a netscape 4.x window is resized.

After installing cooljsmenus, my page no longer reloads when resized in NN 4.x.

I looked at the coolmenus.js file, and I see that it has a resize handler in it (which explains why the resize handler used by Dreamweaver doesn't get called anymore!), but nevertheless, the page doesn't reload in NN 4.x.

Any thoughts?

Thank you.
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Sun Jun 15, 2003 7:29 am    Post subject: Reply with quote

If your onresize handler will always reload window, then you can find the following line in the coolmenu.js and comment it out with '//':

if (bw.ns4) window.onresize=resizeHandler;

Let me know if you need some wiser solution.
Back to top
camner



Joined: 05 Jun 2003
Posts: 21

PostPosted: Sun Jun 15, 2003 4:16 pm    Post subject: Reply with quote

It doesn't ALWAYS reload (see below), but always does when it needs to. It seems that yours doesn't reload when it needs to (try http://www.charleswright.org in NS 4 and resize!). I'm happy to use your code, but it doesn't seem to resize my page when it needs to.

I was using DreamWeaver's code which seems to resize only when "innerWidth" or "innerHeight" change:

function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
Back to top
camner



Joined: 05 Jun 2003
Posts: 21

PostPosted: Sun Jun 15, 2003 9:59 pm    Post subject: Reply with quote

OK, further exploration turns up something puzzling. If I delete all references to cooljsmenu (by removing the 3 lines that reference it--coolmenus.js, menuitems.js, and the function call), the window reloads on resize, as expected, using Dreamweaver's onresize handler. If I include the 3 cooljsmenu references, the window does NOT reload, even after commenting out the line you suggested in your earlier reply.

I know this doesn't make much sense, but that's what it does. I took the precaution of deleting NS cache files and rebooting the computer, just in case...

Any other thoughts?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu All times are GMT
Page 1 of 1