473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Netscape DHTML not working

OK, I know this issue has been beat to death, but I have tested my
script in Netscape 7.1 and it does seem to be getting the calculated
values it needs to create placement coordinates, and every example I
can find that 'works' in my netscape browser "appears" to use the same
style references to the various div objects that I am trying to use.
Yet even though I have verified the script is stepping through the
doResize subroutine, and the values are valid, nothing on my page gets
moved.

It works just great in IE6 but even with some cross browser
incompatibility, I would still expect that at least 'something' would
be modified in the netscape version but nuttin! What am I missing?
(and yes, I have compared my DOCTYPE definitions to those of
'functional' pages too)

// here's a sample of my js code to resize various div elements on my
page

// retreive an object including cross-browser support
function getObj(name) {
if (document.getElementById) {
if(document.getElementById(name)) {
this.obj = document.getElementById(name);
}
} else if (document.all) {
if(document.getElementById(name)) {
this.obj = document.all[name];
}
} else if (document.layers) {
if(document.layers[name]) {
this.obj = document.layers[name];
alert(name+" width:"+document.layers[name].width);
}
}
return this.obj;
}
// handle dynamic resizing of the various layers making up the page
framework
function doResize() {
// allBodyObj = new getObj('allBody');
olArcTopObj = new getObj('olArcTopDiv');
olArcTilObj = new getObj('olArcTilDiv');
olArcBotObj = new getObj('olArcBotDiv');

orArcObj = new getObj('orArcDiv');
orArcTopObj = new getObj('orArcTopDiv');
orArcTilObj = new getObj('orArcTilDiv');
orArcBotObj = new getObj('orArcBotDiv');
tlBlueObj = new getObj('tlBlueDiv');
ilArcTopObj = new getObj('ilArcTopDiv');
ilArcTilObj = new getObj('ilArcTilDiv');
ilArcBotObj = new getObj('ilArcBotDiv');
blBlueObj = new getObj('blBlueDiv');

trBlueObj = new getObj('trBlueDiv');
irArcObj = new getObj('irArcDiv');
irArcTopObj = new getObj('irArcTopDiv');
irArcTilObj = new getObj('irArcTilDiv');
irArcBotObj = new getObj('irArcBotDiv');
brBlueObj = new getObj('brBlueDiv');

orightNavObj = new getObj('orightNav');

centContObj = new getObj('centCont');

var xwid = document.body.clientWidth;
var yhig = document.body.clientHeight;

// pad x and y values for testing by border sizes
var padX = ilArcTilObj.offsetWidth + irArcTilObj.offsetWidth;
var padY = tlBlueObj.offsetHeight + blBlueObj.offsetHeight;

if(xwid < (cM.curX + padX)) { xwid = cM.curX + padX; }
if(yhig < (cM.curY + padY)) { yhig = cM.curY + padY; }

//if(is_nav) {
//} else {
// adjust outer arc X & Y axis
olArcTilObj.style.height = yhig - (olArcBotObj.offsetHeight +
olArcTopObj.offsetHeight); // stretch or contract outer left arc
elastic middle on y-axis
olArcBotObj.style.top = yhig - (olArcBotObj.offsetHeight +
tlBlueObj.offsetHeight); // move outer left arc bottom up or down
orArcTilObj.style.height = yhig - (orArcBotObj.offsetHeight +
orArcTopObj.offsetHeight + brBlueObj.offsetHeight); // stretch or
contract outer right arc elastic middle on y-axis
orArcBotObj.style.top = yhig - (orArcBotObj.offsetHeight +
brBlueObj.offsetHeight); // move outer right arc bottom up or down
orArcObj.style.left = xwid - orArcObj.offsetWidth; // move entire
outer right arc left or right

// adjust X-axis values
blBlueObj.style.width = xwid - brBlueObj.offsetWidth; // stretch or
contract bottom left blue box on x-axis
trBlueObj.style.width = xwid - tlBlueObj.offsetWidth; // stretch or
contract top right blue box on x-axis
centContObj.style.width = xwid - padX; // adjust width of center
content frame
irArcObj.style.left = xwid - irArcObj.offsetWidth; // move inner
right arc left or right
brBlueObj.style.left = xwid - brBlueObj.offsetWidth; // move bottom
right blue gradient left or right

// adjust Y-axis values
ilArcTilObj.style.height = yhig - (ilArcBotObj.offsetHeight +
ilArcTopObj.offsetHeight); // stretch or contract inner right arc
elastic middle on y-axis
ilArcBotObj.style.top = yhig - ilArcBotObj.offsetHeight; // move
inner left arc bottom up or down
blBlueObj.style.top = yhig - blBlueObj.offsetHeight; // move
bottom left blue box up or down
centContObj.style.height = yhig - padY; // adjust height of center
content frame
irArcTilObj.style.height = yhig - (irArcBotObj.offsetHeight +
irArcTopObj.offsetHeight); // stretch or contract inner right arc
elastic middle on y-axis
irArcBotObj.style.top = yhig - irArcBotObj.offsetHeight; // move
inner right arc bottom up or down
brBlueObj.style.top = yhig - brBlueObj.offsetHeight; // move
bottom right gradient up or down

// outer right nav should be offset from bottom right
orightNavObj.style.left = xwid - 220; // move outer right nav bar
left or right
orightNavObj.style.top = yhig - 300; // move outer right nav bar up
or down
//}
}
Jul 20 '05 #1
1 2855


Catherine Lynn Smith wrote:
OK, I know this issue has been beat to death, but I have tested my
script in Netscape 7.1 and it does seem to be getting the calculated
values it needs to create placement coordinates, and every example I
can find that 'works' in my netscape browser "appears" to use the same
style references to the various div objects that I am trying to use.
Yet even though I have verified the script is stepping through the
doResize subroutine, and the values are valid, nothing on my page gets
moved.

It works just great in IE6 but even with some cross browser
incompatibility, I would still expect that at least 'something' would
be modified in the netscape version but nuttin! What am I missing?
(and yes, I have compared my DOCTYPE definitions to those of
'functional' pages too)

var xwid = document.body.clientWidth;
var yhig = document.body.clientHeight;
While later versions of Netscape implement clientWidth/clientHeight you
should use
window.innerWidth
window.innerHeight
if you want your script to work with all versions of Netscape 4, 6, 7
olArcTilObj.style.height = yhig - (olArcBotObj.offsetHeight +
olArcTopObj.offsetHeight); // stretch or contract outer left arc
elastic middle on y-axis
olArcBotObj.style.top = yhig - (olArcBotObj.offsetHeight +
tlBlueObj.offsetHeight); // move outer left arc bottom up or down


CSS properties like height or left or top need a number plus a unit e.g.
in a stylesheet you use
height: 200px;
left: 10px;
and if you use script you need to do the same so you need to add units
to all those assignments e.g.
olArcTilObj.style.height =
yhig - (olArcBotObj.offsetHeight + olArcTopObj.offsetHeight) + 'px';

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

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

Similar topics

6
by: Terry | last post by:
Hi, I hope this problem I ran into has an easy fix. I created a menu bar for my page using Sothink DHTML Menu 4.1 which created javascript file. I also add a small slide show on the page...
7
by: Ingmund Sjåstad | last post by:
This scipt is working in IE6 but not in Netscape 7. What am I doin wrong? <script language="JavaScript" type="text/JavaScript"> var ns = false; var ie = false; ie = (document.all) ? true :...
6
by: Ingmund Sjåstad | last post by:
Trying to make a dropdown menu. I working nice in IE6 but when I try a link in Netscape 7 nothing happens. Can anybody help me? <html> <head> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0...
9
by: rez | last post by:
I find it rather frustrating that Netscape 4.x is "no longer supported:" http://help.netscape.com/products/client/communicator/reflib.html Same seems true with IE. How am I ever supposed to...
7
by: Scott | last post by:
Hello All, I've been reading all of the various issues with Iframes in netscape. I have tried all of the various fixes posted, and have even implemented both an iframe and ilayer. My problem is...
11
by: Jonny | last post by:
Netscape 7.02 is giving me a headache with a downloaded snow script. Starting with a blank page, I inserted the script and checked it in IE 6 and Netscape 7.02. Everything worked and looked fine. A...
1
by: Ahmad Noori | last post by:
I have a form and in the form, I have a drop down box. Based on what the user selects, i want to display different input boxes. Here is my drop down box: <td> <select name="reptype"...
18
by: Dennis | last post by:
It seems that garbage collection is somewhat flawed in Netscape as the following little script can bring a machine to its knees in about an hour when run on Netstcape 7.1. I've tried freeing the...
2
by: lawrence | last post by:
I thought I was fighting a PHP problem, so I asked about this on a PHP list, but they felt it was a Javascript problem, so I'm reposting a bit of the debate here. Could this Javascript, below,...
4
by: Monte Gardner | last post by:
I'm trying to create an effect wherein an HTML page contains a large number of products (up to 125 possibly). Initially, only the first 3 are displayed. When the user clicks on a 'next' or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.