473,790 Members | 3,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

object width and browser compatibility

resending with better URL

At the URL http://www.spfldcycling.org/miles/06_12_detail.htm , I'm having
difficulty resizing a DIV object when the window resizes. I want to get the
left and top positions of the DIV, then calculate the width and height. I
can get the window dimensions fine, but since I can't get the left and top I
had to use constants, which isn't a good idea. Also, the page doesn't work
well in Netscape. The header shifts all the way to the right on top of the
empty corner cell, and the name list sometimes disappears and comes back
again if resized in the other axis. IE is fine. If someone could look at
this and give me suggestions I'd appreciate it. The function with constants
is pasted below.

The page is created by a VB6 program and uploaded via FTP. I put it out with
a debug switch set, so extra spaces and line feeds are included. If the
records keeper uploads again, those will go away, but for the time being the
page source can be easily read.

function redraw() {
if (dd) {
var ww=f_clientWidt h();
var wh=f_clientHeig ht();
if (ww<500) ww=500;
if (wh<500) wh=500;
dd.style.width= ww-160;
dd.style.height =wh-175;
hh.style.width= ww-175;
nn.style.height =wh-190;
}
}

dd is set at the end of the page by:

var hh=document.get ElementById('he ad');
var nn=document.get ElementById('na mes');
var dd=document.get ElementById('de tail');

--
dgm
Dec 23 '06 #1
2 1471
>From: David McDivitt <da*******@de l-subjectivist.or g>
>Date: Sat, 23 Dec 2006 15:55:51 -0600
Lines: 39

resending with better URL

At the URL http://www.spfldcycling.org/miles/06_12_detail.htm , I'm having
difficulty resizing a DIV object when the window resizes. I want to get the
left and top positions of the DIV, then calculate the width and height. I
can get the window dimensions fine, but since I can't get the left and top I
had to use constants, which isn't a good idea. Also, the page doesn't work
well in Netscape. The header shifts all the way to the right on top of the
empty corner cell, and the name list sometimes disappears and comes back
again if resized in the other axis. IE is fine. If someone could look at
this and give me suggestions I'd appreciate it. The function with constants
is pasted below.

The page is created by a VB6 program and uploaded via FTP. I put it out with
a debug switch set, so extra spaces and line feeds are included. If the
records keeper uploads again, those will go away, but for the time being the
page source can be easily read.

function redraw() {
if (dd) {
var ww=f_clientWidt h();
var wh=f_clientHeig ht();
if (ww<500) ww=500;
if (wh<500) wh=500;
dd.style.width= ww-160;
dd.style.height =wh-175;
hh.style.width= ww-175;
nn.style.height =wh-190;
}
}

dd is set at the end of the page by:

var hh=document.get ElementById('he ad');
var nn=document.get ElementById('na mes');
var dd=document.get ElementById('de tail');

I resolved the position issue with the code pasted below. I forgot the left
values were relative to the parent. And for some reason, Netscape works now,
too! I didn't change the part Netscape didn't like but what the hell. If
resized too small horizontally, Netscape will squeeze the name column, then
not restore if sized back out again. With Netscape the DIV ending sizes
leave different space to the edge of the window, varying randomly from one
resize to the next, but it doesn't look bad. It's just not consistent in
Netscape. But I'm happy. A constant of 10 gives a nice margin to the window.
The constant of 25 is 10 plus the width of the scrollbar.

function redraw() {
if (dd) {
var ww=f_clientWidt h();
var wh=f_clientHeig ht();
if (ww<500) ww=500;
if (wh<500) wh=500;
var calc=ww-left(dd)-10;
if (dd.style.width !=calc) dd.style.width= calc;
calc=wh-top(dd)-10;
if (dd.style.heigh t!=calc) dd.style.height =calc;
calc=ww-left(hh)-25;
if (hh.style.width !=calc) hh.style.width= calc;
calc=wh-top(nn)-25;
if (nn.style.heigh t!=calc) nn.style.height =calc;
}
}
function left(ob) {
var sum=0;
var o=ob;
while (o) {
sum+=o.offsetLe ft;
o=o.offsetParen t;
}
return sum;
}
function top(ob) {
var sum=0;
var o=ob;
while (o) {
sum+=o.offsetTo p;
o=o.offsetParen t;
}
return sum;
}

--
dgm
Dec 24 '06 #2
>From: David McDivitt <da*******@de l-subjectivist.or g>
>Date: Sat, 23 Dec 2006 19:40:35 -0600
Lines: 89

I resolved the position issue with the code pasted below. I forgot the left
values were relative to the parent. And for some reason, Netscape works now,
too! I didn't change the part Netscape didn't like but what the hell. If
resized too small horizontally, Netscape will squeeze the name column, then
not restore if sized back out again. With Netscape the DIV ending sizes
At this page http://www.spfldcycling.org/miles/06_12_detail.htm , I noticed
the text screws up when scrolling horizontally, in IE, if the browser zoom
is not 100%. The text screws up but the cell borders travel where they
should. Now I have to include a note saying to insure zoom is 100%. Is there
a way to see what the zoom value is so I can display a warning?

--
dgm
Dec 24 '06 #3

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

Similar topics

16
11501
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not an object... the function is like so: function calc_total() { var x,i,base,margin,total,newmargin,newtotal; base = document.frmKitAmount.txtTotalKitValue.value; margin = document.frmKitAmount.margin.value/100;
8
2034
by: AC | last post by:
I hope someone can tell me why this is not working. I have a form that dynamically creates the code below. This is for one product and there are about 10 to 50 products that are listed depending on what manufacturer the user selects. After "buying" a few products (4-8) they user gets the error message: 'QUANTITY.value' is null or not an object. Do you see a workaround/fix for this? I posted this on February 19, 2004 under the title...
1
3029
by: Brian Rosenthal | last post by:
I'm having a browser compatibility issue with NS 4.72. I cannot seem to get a frame of 1 px width. Does anyone know what the compatibility workaround is here? Here's the page in question: http://bcforged.xcitemedia.com/test.html It's easy to tell what it's supposed to look like because it looks fine in IE.
11
4499
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after that I've got confused. For example, what should be put into classid and codebase attributes of the OBJECT now embedding the EMBED tag?
5
3088
by: fred | last post by:
I don't know if I'm doing this correctly. I have a little programming experience in python, c++ and some others but this is my first time with javascript. I'm trying have my website detect the user's browser and assign a variable with different items if it's Internet Explorer. My code works with firefox, opera and others but not IE. <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled...
1
3772
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
1
1728
by: laredotornado | last post by:
Hello, I"m looking for a cross-browser (Firefox 1+, IE 6+, Safari whatever+) to calculate the width of the viewable browser area. Note that this is different than the screen width, which would always stay the same value, even if you started resizing your browser. Much thanks for your help, - Dave
2
1563
by: laredotornado | last post by:
Hello, I am looking for a cross browser way (IE, Firefox, Safari) of getting the screen width, in pixels, of an element on my page. I am interested in the "navImg" table cell. Here is a snippet of code: <tr> <td style="width:45px; height:38px;" id="navImg" name="navImg"><img src="images/NAV_07.gif" alt="" border="0"></td>
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10419
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10201
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7531
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6770
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.