CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 7th, 2000, 06:44 PM
rootdr rootdr is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 8 rootdr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

If there are any JS gurus here, I would REALLY appreciate their help in slimming down some JS that is produced by GolIve 4.0. I need this Netscape fix since I am using CSS that are subject to the resize bug in Netscape. If someone resizes their browser window at my site, the CSS styles are thrown out the window. It seems there is a bug in the JS code. On resizing Netscape windows, with the GoLive created JS inline or externally referenced to a .js file, the page reloads itself TWICE. If you quickly manage to see the page after the first reload, you can see that the second reload is not necessary.

I believe I have removed what could be considered as extraneous code and have made the listing below into an external JS file that is referenced with: <script language="JavaScript" src="/js/ns_fix.js"></script>. Within the <body> I have also added: onLoad="CSScriptInit();

There must be somebody who can solve this problem that I believe will slim down the code generated by GL's NS fix action for EVEYBODY's benefit.

Many thanks.

rootdr
--
"External JS file: ns_fix.js"

CSStopExecution = false;
CSInit = new Array;
function CSScriptInit() {
if(typeof(skipPage) != "undefined") { if(skipPage) return; }
idxArray = new Array;
for(var i=0;i<CSInit.length;i++)
idxArray[i] = i;
CSAction2(CSInit, idxArray);
}
CSStopExecution = false;

function CSAction(array) {
return CSAction2(CSAct, array);
}
function CSAction2(fct, array) {
var result;
for (var i=0;i<array.length;i++) {
if(CSStopExecution) return false;
var actArray = fct[array[i]];
if(actArray == null) return false;

var tempArray = new Array;
for(var j=1;j<actArray.length;j++) {
if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {
if(actArray[j][0] == "VAR") {
tempArray[j] = CSStateArray[actArray[j][1]];
}
else {
if(actArray[j][0] == "ACT") {
tempArray[j] = CSAction(new Array(new String(actArray[j][1])));
}
else
tempArray[j] = actArray[j];
}
}
else
tempArray[j] = actArray[j];
}
result = actArray[0](tempArray);
}
return result;
}
CSAct = new Object;
function CSFixFct() {
var d = document; var w = window;
if (d.cs.csFix.w != w.innerWidth | | d.cs.csFix.h != w.innerHeight) {
d.location = d.location; }
}
function CSNSFix(action) {
var d = document; var w = window;
if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
if (typeof d.cs == 'undefined') {
d.cs = new Object;
d.cs.csFix = new Object;
} else if (CSIsFrame (w) == true) CSFixFct();
d.cs.csFix.w = w.innerWidth;
d.cs.csFix.h = w.innerHeight;
window.onresize = CSFixFct;
}
}
function CSIsFrame (window) {
var rootWindow = window.parent;
if (rootWindow == 'undefined') return false;
for (i = 0; i < rootWindow.frames.length; i++)
if (window == rootWindow.frames[i]) return true;
return false;
}

CSInit[CSInit.length] = new Array(CSNSFix);

Reply With Quote
  #2  
Old April 13th, 2000, 04:06 AM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
cal this function from the <body onload="NSresize()">it should do the job in most cases.

function NSresize(){
function resized(){
if(pageWidth!=innerWidth | | pageHeight!=innerHeight){
location.reload()
}
}


if(document.layers){
pageWidth=innerWidth
pageHeight=innerHeight
window.onresize=resized
}
}




------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > JS fix for NS CSS bug, help plz

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap