473,652 Members | 3,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Manipulating "obj.style.heig ht " don't work in IE7...?

I have the following function to resize a div element (Content) depending on
the
size of another div element (leftConent).

function adjustContentHe ight() {
var content = document.getEle mentById("Conte nt");
var leftOne = document.getEle mentById("leftC ontent ");
content.style.h eight = (leftOne.offset Height + leftOne.offsetT op) + "px";

return true;
}
This code works as expected in IE6 and FF2.0, but when testing in IE7
nothing
happens... the "Content" div is not resized.

Can anyone shed some light on why?

TIA...

--
Dag.
Dec 20 '06 #1
2 3443
Dag Sunde wrote:
I have the following function to resize a div element
(Content) depending on the
size of another div element (leftConent).

function adjustContentHe ight() {
var content = document.getEle mentById("Conte nt");
var leftOne = document.getEle mentById("leftC ontent ");
content.style.h eight = (leftOne.offset Height + leftOne.offsetT op) +
"px";

return true;
}

This code works as expected in IE6 and FF2.0, but when
testing in IE7 nothing
happens... the "Content" div is not resized.

Can anyone shed some light on why?
CSS changes in IE 7 appear to be having knock-on effects for scripts.
Earlier in the week I traced an instance of a block of dynamically
generated elements not showing in IE 7 to a containing DIV that had been
set to position:relati ve, and as a result had started reporting zero
offsetWidth, wen though it had width:100% and a screen-width CSS
positioned container (probably a consequence of that DIV only having
absolutely positioned descendants and so not having any flowable
content). Switching the DIV to position:absolu te solved that problem as
then the DIV did report its offsetWidth as non-zero (and it had never
needed to be relatively positioned to start with).

In any event, you won't get others to identify your problems with script
alone. They need to see the mark-up and the CSS to attribute genuine
cause and effect relationships. That is, you should create a cut down
test-case page that demonstrates the issue in isolation.

Richard.
Dec 20 '06 #2
Richard Cornford wrote:
Dag Sunde wrote:
>I have the following function to resize a div element
(Content) depending on the
size of another div element (leftConent).

function adjustContentHe ight() {
var content = document.getEle mentById("Conte nt");
var leftOne = document.getEle mentById("leftC ontent ");
content.style.h eight = (leftOne.offset Height + leftOne.offsetT op) +
"px";

return true;
}

This code works as expected in IE6 and FF2.0, but when
testing in IE7 nothing
happens... the "Content" div is not resized.

Can anyone shed some light on why?

CSS changes in IE 7 appear to be having knock-on effects for scripts.
Earlier in the week I traced an instance of a block of dynamically
generated elements not showing in IE 7 to a containing DIV that had
been set to position:relati ve, and as a result had started reporting
zero offsetWidth, wen though it had width:100% and a screen-width CSS
positioned container (probably a consequence of that DIV only having
absolutely positioned descendants and so not having any flowable
content). Switching the DIV to position:absolu te solved that problem
as then the DIV did report its offsetWidth as non-zero (and it had
never needed to be relatively positioned to start with).

In any event, you won't get others to identify your problems with
script alone. They need to see the mark-up and the CSS to attribute
genuine cause and effect relationships. That is, you should create a
cut down test-case page that demonstrates the issue in isolation.
I know, but I dreaded the task of ripping that page down to a simple
example actually reproducing the problem. It's a closed intranet
page, heavy with JS manipulation runtime. (You know, one of those
where you don't have to care about missing JS or other browsers than
IE).

It turned out to be more of a css-problem, really...
Something like the sample at the bottom of this page:
http://msdn.microsoft.com/library/de...css_compat.asp

But thank you for the response.

--
Dag.
Dec 20 '06 #3

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

Similar topics

17
7257
by: Torbjørn Pettersen | last post by:
I've got a table where I want some of the cells to use a background image. The cells have variable height, so I am using an image with a rather small height to fill up the background of the cells, thus making I look like one high image in there. When validating it, I get this error: there is no attribute "BACKGROUND" The validators also tell me there are no "HEIGHT" or
1
686
by: Markus Elfring | last post by:
How much are you interested that the attribute "style" will offer the same or similar capabilities like they are provided by the element "style" in the element "head"? Do you want that the document "Syntax of CSS rules in HTML's "style" attribute" (http://www.w3.org/TR/css-style-attr) will become an official recommendation in the near future? Best regards, Markus Elfring
2
8658
by: Manuel Reimer | last post by:
Hello, I'm trying to get valid HTML for my homepage. The following links opens the W3C validator with my homepages source: http://validator.w3.org/check?uri=http%3A%2F%2Fweb262.server2.dce4u.de%2F I get the error "there is no attribute "HEIGHT"". I need this "HEIGHT" to get the table at least as high as the browsers display area. How can I replace my "HEIGHT" to get the same effect?
4
4667
by: mike | last post by:
regards: <a href="JavaScript:loadwindow(106,90);" style="font-family:Verdana;">元智Intranet</a> In HTML spec,are "href" and "style" called "attribute"?....@@ Could someone good give me the hand? @@. thank you may god be with you
5
17686
by: johnsuth | last post by:
I want to produce a trivial demonstration of dynamic modification. I thought that pressing a button might change its color. I studied O'Reillys books and successfully created the button with a fancy style, but the onclick fails to do anything no matter what permutation of parameters I try. <input type=button style=background-color:yellow;color:blue;font-family:Arial;font-style:italic;font-weight:bold name="xyz" value="CHANGE COLOUR"...
1
3288
by: vad | last post by:
Hi, Can anybody explain me, please, what the folder "obj" in VB.NET 2005 for? And what the difference between folders "bin" and "obj"? Thank you.
8
9258
by: fredo | last post by:
This question was asked in comp.lang.javascript with no result. In IE5.x and IE6, I want to display an image when the user rolls over a text link. The image does indeed display, but only on the first rollover. It seems that the image height and width become set to zero after the image is displayed once; or perhaps that the height:expression(eval(...)); code is executed only once for each page load/reload. problem demo:
16
4469
by: Tantale | last post by:
I used this serviec to check my webpage http://www.jmrw.com/Abroad/Barcelone/index.htm Made with Dreamweaver 8. The result is 206 errors, most of them "end tag omitted, but OMITTAG NO was specified.". I don't understand this result. Should I modify something ? Thanks
2
5998
by: CGatto | last post by:
Hi, We have just started getting the following error during compiles of our forms-based application. We are developing in VS2008, VB.Net, with Team Foundation Server-based source control. Full error message is: "Unable to copy file "obj\Debug\OurProjectName.xml" to "bin\Debug\OurProjectName.xml". Access to the path 'obj\Debug\OurProjectName.xml' is denied."
0
8367
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
8811
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
8703
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
8467
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,...
0
8589
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2703
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
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.