473,394 Members | 1,865 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,394 software developers and data experts.

Size and position

Hi,

I am currently trying to do some Javascript sizing and positioning using
Javascript and encounter some for me unexpected behaviour in IE6, yet
works fine in Firefox and Opera.

I have a table with some various elements in it and want it to take into
account the current browser viewport size and resize it relative to that.

The calculations seem to be working well, but when I assign a height to
the table style (element.style.height = "681px") the element will get a
clientHeight of 748 in IE6, while it's 679 is Firefox and Opera (due to
the 1px border).

What can influence the clientHeight in IE6 in this way?

Furthermore, are there any free, open-source, Javascript functions that
you can use to set the dimensions and positions of elements?

Or can you suggest me some good website that explains this whole sizing
and positioning topic in Javascript.

Thanks,
Robert.
Sep 28 '06 #1
5 1534
Robert wrote:
Hi,

I am currently trying to do some Javascript sizing and positioning using
Javascript and encounter some for me unexpected behaviour in IE6, yet
works fine in Firefox and Opera.

I have a table with some various elements in it and want it to take into
account the current browser viewport size and resize it relative to that.

The calculations seem to be working well, but when I assign a height to
the table style (element.style.height = "681px") the element will get a
clientHeight of 748 in IE6, while it's 679 is Firefox and Opera (due to
the 1px border).

What can influence the clientHeight in IE6 in this way?

Furthermore, are there any free, open-source, Javascript functions that
you can use to set the dimensions and positions of elements?

Or can you suggest me some good website that explains this whole sizing
and positioning topic in Javascript.
Don't use JavaScript at all for this, use CSS. Ask in:

news:comp.infosystems.www.authoring.stylesheets

--
Rob
Sep 28 '06 #2
RobG wrote:
Robert wrote:
>Hi,

I am currently trying to do some Javascript sizing and positioning
using Javascript and encounter some for me unexpected behaviour in
IE6, yet works fine in Firefox and Opera.

I have a table with some various elements in it and want it to take
into account the current browser viewport size and resize it relative
to that.

The calculations seem to be working well, but when I assign a height
to the table style (element.style.height = "681px") the element will
get a clientHeight of 748 in IE6, while it's 679 is Firefox and Opera
(due to the 1px border).

What can influence the clientHeight in IE6 in this way?

Furthermore, are there any free, open-source, Javascript functions
that you can use to set the dimensions and positions of elements?

Or can you suggest me some good website that explains this whole
sizing and positioning topic in Javascript.


Don't use JavaScript at all for this, use CSS. Ask in:

news:comp.infosystems.www.authoring.stylesheets
What I am trying to do is not possible with CSS.
I have examined the possibilities and limits for weeks.
Sep 28 '06 #3
Robert said the following on 9/28/2006 4:11 AM:
Hi,

I am currently trying to do some Javascript sizing and positioning using
Javascript and encounter some for me unexpected behaviour in IE6, yet
works fine in Firefox and Opera.

I have a table with some various elements in it and want it to take into
account the current browser viewport size and resize it relative to that.
Then use % sizes. It's a CSS issue.
The calculations seem to be working well, but when I assign a height to
the table style (element.style.height = "681px") the element will get a
clientHeight of 748 in IE6, while it's 679 is Firefox and Opera (due to
the 1px border).
Thats because of the difference in the way IE calculates height, and
what is included and what isn't. It's a CSS issue.
What can influence the clientHeight in IE6 in this way?
First you have to find out why there is such a huge difference in the
clientHeight and the height you specified. 67 pixels is a lot.

It's a CSS issue.
Furthermore, are there any free, open-source, Javascript functions that
you can use to set the dimensions and positions of elements?
Try Matt Kruse's www.javascripttoolbox.com site, it may have a library
for that.
Or can you suggest me some good website that explains this whole sizing
and positioning topic in Javascript.
It's a CSS issue.

P.S. Did I mention that your problem is a CSS issue?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 28 '06 #4
Randy Webb wrote:
Robert said the following on 9/28/2006 4:11 AM:
>Hi,

I am currently trying to do some Javascript sizing and positioning
using Javascript and encounter some for me unexpected behaviour in
IE6, yet works fine in Firefox and Opera.

I have a table with some various elements in it and want it to take
into account the current browser viewport size and resize it relative
to that.

Then use % sizes. It's a CSS issue.
It is impossible to accomplish my goals using % sizes.
>The calculations seem to be working well, but when I assign a height
to the table style (element.style.height = "681px") the element will
get a clientHeight of 748 in IE6, while it's 679 is Firefox and Opera
(due to the 1px border).

Thats because of the difference in the way IE calculates height, and
what is included and what isn't. It's a CSS issue.
I am aware of some differences, but not the huge difference in this case.
>What can influence the clientHeight in IE6 in this way?

First you have to find out why there is such a huge difference in the
clientHeight and the height you specified. 67 pixels is a lot.
I finally found out that the difference came because IE misintepreted a
table cell that had a rowspan of 2. It counted the 2nd row two times to
calculate the height. So it actually was a IE, HTML and CSS issue.
>
It's a CSS issue.
No, it was not.
>Furthermore, are there any free, open-source, Javascript functions
that you can use to set the dimensions and positions of elements?

Try Matt Kruse's www.javascripttoolbox.com site, it may have a library
for that.
I checked it before and unfortunately it can only set position and not
the size of an element.
>Or can you suggest me some good website that explains this whole
sizing and positioning topic in Javascript.

It's a CSS issue.
Firefox and IE has dozens of javascript properties related to size and
position. I am interested in clear documentation and examples about
those. I do not need additional information about CSS properties,
because I have enough knowledge about them already.
P.S. Did I mention that your problem is a CSS issue?
P.S. your sarcasm is not appreciated and think you need to apologize.
Maybe you have spend too much time here already.
Sep 28 '06 #5
Robert wrote:
Randy Webb wrote:
Robert said the following on 9/28/2006 4:11 AM:
Hi,

I am currently trying to do some Javascript sizing and positioning
using Javascript and encounter some for me unexpected behaviour in
IE6, yet works fine in Firefox and Opera.

I have a table with some various elements in it and want it to take
into account the current browser viewport size and resize it relative
to that.
Then use % sizes. It's a CSS issue.

It is impossible to accomplish my goals using % sizes.
Without an example, or even reasonable explanation, of what you are
trying to do, that conversation is pointless.

The calculations seem to be working well, but when I assign a height
to the table style (element.style.height = "681px") the element will
get a clientHeight of 748 in IE6, while it's 679 is Firefox and Opera
(due to the 1px border).
Thats because of the difference in the way IE calculates height, and
what is included and what isn't. It's a CSS issue.

I am aware of some differences, but not the huge difference in this case.
What can influence the clientHeight in IE6 in this way?
First you have to find out why there is such a huge difference in the
clientHeight and the height you specified. 67 pixels is a lot.

I finally found out that the difference came because IE misintepreted a
table cell that had a rowspan of 2. It counted the 2nd row two times to
calculate the height. So it actually was a IE, HTML and CSS issue.
So it was a CSS issue?

It's a CSS issue.

No, it was not.
But you just said " it actually was a IE, HTML and CSS issue". The
core issue is that you are trying to use JavaScript for something that
should be fixed using CSS.

Furthermore, are there any free, open-source, Javascript functions
that you can use to set the dimensions and positions of elements?
Try Matt Kruse's www.javascripttoolbox.com site, it may have a library
for that.

I checked it before and unfortunately it can only set position and not
the size of an element.
Or can you suggest me some good website that explains this whole
sizing and positioning topic in Javascript.
You can browse Quirksmode:

<URL; http://www.quirksmode.org/js/contents.html >

The layout has recently changed, there is a lot of good information
there. Spend some time poking around. But JavaScript doesn't do any
sizing and positioning, it provides a mechanism to modify the
properties of host properties. It is those properties that you are
trying to understand - once you know what you are trying to do, you
*might* be able to use JavaScript to achieve it.

It's a CSS issue.
Yes, it really is.

Firefox and IE has dozens of javascript properties related to size and
position. I am interested in clear documentation and examples about
those.
Mozilla: <URL: http://developer.mozilla.org/en/docs/DOM:style >

IE: <URL:
http://msdn.microsoft.com/workshop/a.../obj_style.asp
>
You should also search this news group for getComputedStyle and
currentStyle.

However, the above will only tell you about accessing properties. How
they work in relation to each other and their effect in different
browsers is a CSS issue and should be discussed in a CSS forum.

I do not need additional information about CSS properties,
because I have enough knowledge about them already.
Clearly not, you didn't anticipate the effects of rowspan on your code.
Had you approached a CSS forum with a concise explanation and example
(they tend to prefer links to pages rather than posted code), you may
have been given an answer.

If you are trying to use JavaScript to paper over differences in HTML,
CSS and the style related properties of host objects, then likely you
are heading down a path to instabilty and poor maintainability.
--
Rob

Sep 28 '06 #6

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

Similar topics

35
by: wired | last post by:
Hi, I've just taught myself C++, so I haven't learnt much about style or the like from any single source, and I'm quite styleless as a result. But at the same time, I really want nice code and I...
12
by: Brett L. Moore | last post by:
Hi, I have had trouble determining whether the STL list.size() operation is O(1) or O(n). I know the list is a doubly-linked list, so if the size() operation begins at the head, then counts to...
2
by: Billy | last post by:
Hi, This is in connection to the tread: Re: changing browser text settings?? I am wondering if there is a way to retrieve the browsers text size (not change! ;-) ) so that I can dynamically...
2
by: grayFalcon | last post by:
Hello! I've got a small problem here. I'm trying to write some code that would generate a drop-down menue for me, where I'd just need to enter the menu- and submenu items into an array. The...
3
by: spencer | last post by:
Hello, I have an index page with an autoscroller writen with CSS. The problem is the scrolling content(text and inages)'s position is correct but will off position when the broswer(IE) window...
5
by: Francois Soucy | last post by:
Hi all! I've created a personal control. This control is mainly a panel with some other stuff in. I want to know if it's possible to know the size of the container of this control? I mean that my...
14
by: Galen Somerville | last post by:
My current screen resolution is set to 1024 x 768. My form size always comes up as 1032 x 748. I have tried the help sample ' Retrieve the working rectangle from the Screen class ' using the...
4
by: BrianKE | last post by:
I am attempting to create an app that will run "on top" of another app. My app will create a transparent window over the other app for the purpose of displaying information. I am able to create...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I find the size of a browser window?...
20
by: Ashit Vora | last post by:
Hi, I 'm new to C programming and 'm stuck somewhere. I want to find the size of a file. I couldn't find a proper way of doing it. What I was planning to do is... Open the requested file,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.