CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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: 741 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway