473,791 Members | 3,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to get Height and Width of an object (Mozilla 1.4)

Using Mozilla 1.4... I need to get the Height and Width of an object (in
this case, a parent DIV) for the purpose of creating a textbox of max width
and height in the container. Since innerHeight/Width don't work correctly
in Mozilla 1.4, I've tried using getComputedStyl e as noted in another
newsgroup, but with no success; errors tend to range from "Cannot create
object in this context" to other various errors...

The below sample doesn't work, so I'm hoping someone can help me with a
coherent approach that will work... :)

Thanks!
Jack

winW=document.d efaultView.getC omputedStyle(do cument.getEleme ntById('myConta i
ner'),null).get PropertyValue(' width');
Jul 20 '05 #1
3 14866
DU
Jack Black wrote:
Using Mozilla 1.4... I need to get the Height and Width of an object (in
this case, a parent DIV) for the purpose of creating a textbox of max width
and height in the container. Since innerHeight/Width don't work correctly
in Mozilla 1.4,
? innerWidth and innerHeight are window properties and they do work
correctly in Mozilla 1.4.

I've tried using getComputedStyl e as noted in another newsgroup, but with no success; errors tend to range from "Cannot create
object in this context" to other various errors...

But that's a creation element error message, not related to computed style.
The below sample doesn't work, so I'm hoping someone can help me with a
coherent approach that will work... :)
It would have been a lot more easier to figure out your difficulties
with an url.

Thanks!
Jack

winW=document.d efaultView.getC omputedStyle(do cument.getEleme ntById('myConta i
ner'),null).get PropertyValue(' width');

var ContainerWidth = document.getEle mentById("myCon tainer").client Width;
var ContainerHeight = document.getEle mentById("myCon tainer").client Height;

var objTextbox = document.create Element("input" );
objTextbox.type = "text";
objTextbox.styl e.width = ContainerWidth + "px";
objTextbox.styl e.height = ContainerHeight + "px";
etc...
and then you need to append objTextbox to a block-level element within
the form.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/

Jul 20 '05 #2
Thanks for responding... However, Mozilla is reporting an error on the
first assignment:
Error: document.getEle mentByID is not a function
Source File: <snipped>
Line: 1562

Can't believe how difficult Mozilla (and NN) make this compared to IE... ;-)

Thanks for trying.
Jack


"DU" <dr*******@hotR EMOVEmail.com> wrote in message
news:bf******** **@news.eusc.in ter.net...
Jack Black wrote:
Using Mozilla 1.4... I need to get the Height and Width of an object (in this case, a parent DIV) for the purpose of creating a textbox of max width and height in the container. Since innerHeight/Width don't work correctly in Mozilla 1.4,
? innerWidth and innerHeight are window properties and they do work
correctly in Mozilla 1.4.

I've tried using getComputedStyl e as noted in another
newsgroup, but with no success; errors tend to range from "Cannot create
object in this context" to other various errors...


But that's a creation element error message, not related to computed

style.
The below sample doesn't work, so I'm hoping someone can help me with a
coherent approach that will work... :)


It would have been a lot more easier to figure out your difficulties
with an url.

Thanks!
Jack

winW=document.d efaultView.getC omputedStyle(do cument.getEleme ntById('myConta i ner'),null).get PropertyValue(' width');

var ContainerWidth = document.getEle mentById("myCon tainer").client Width;
var ContainerHeight = document.getEle mentById("myCon tainer").client Height;

var objTextbox = document.create Element("input" );
objTextbox.type = "text";
objTextbox.styl e.width = ContainerWidth + "px";
objTextbox.styl e.height = ContainerHeight + "px";
etc...
and then you need to append objTextbox to a block-level element within
the form.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/

Jul 20 '05 #3
"Jack Black" <ja************ *@hotmail.com> writes:
Thanks for responding... However, Mozilla is reporting an error on the
first assignment:
Error: document.getEle mentByID is not a function
The final "D" should be lowercase, you probably typo'ed it.
Can't believe how difficult Mozilla (and NN) make this compared to IE... ;-)


That is probably because you know IE but not Mozilla, otherwise you might
say the converse.

Please respond below the parts of the message you are replying to, and
delete the parts you are not replying to.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4

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

Similar topics

14
21545
by: delerious | last post by:
I need to determine an element's width and height in pixels (not including padding, border, and margin) in Javascript. The element will not have width or height styles specified. In Mozilla, I know I can use document.defaultView.getComputedStyle() to do this. IE does not support document.defaultView.getComputedStyle(). It supports offsetWidth/offsetHeight, but those include the padding and border. IE also supports...
6
3411
by: Jason Bassford | last post by:
Okay, What I'm trying to do is create two boxes, one on top of the other. The first is a static height, the 2nd, underneath it, should take up the remaining amount of screen space and overflow with its own vertical scrollbar for any extra content. I've managed to come up with this, which works perfectly in Mozilla, but fails in IE:
2
23006
by: patrick h. | last post by:
Greetings, I am encountering some issues regarding using float while desiring to set the height to 100%. This is likely due to my own misunderstanding of the way things actually function -- any guidance would be appreciated. To summarize, I would like to have a variable-width, 100% height, left-floating column. However, it seems as though with Mozilla/Netscape that height: 100% is not interpreted as I would
1
6092
by: bin_P19 P | last post by:
the code i have got is as follows and now im stuck <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Shopping Cart</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="StyleSheet" href="css/style.css" type="text/css">
5
6476
by: Dave Hammond | last post by:
You'd think this would be a basic part of the window object (and perhaps it is and I'm just being dense), but I can't find any reference in the IE window object documentation to a property which returns the current window height/width. I can't check Mozilla, as the site is currently unresponsive, but i don't recall there being any mention of height/width properties in the Mozilla window object docs either. Seems like if the object can...
22
6976
by: Les Juby | last post by:
I am trying to adjust the window/table size of a website (www.worklaw.co.za) which has made use of DIV tags with its settings embedded in an CSS file. The client wants its width and height to adjust according to dynamic screen size, and I have been able to adjust the width to a percentage value which works fine. But if I try do the same with the height it shows some very strange results squashing the field to display about 3 lines.
2
13418
by: Atul | last post by:
I am unable to find image height and width in mozilla firefox. My code is working in IE but not in Mozilla. How can i find image width and height in mozilla? function check(sel) { if(sel != "") { document.getElementById('newImg').src = sel; document.getElementById('newImgDiv').style.visibility = "visible"; } }
1
13692
by: since | last post by:
How do I get a html table in mozilla to only have scrollbars if it is exceeds a height. "max-height" used to work but it no longer works for me. I can scrollbars added if it exceeds a height. In the example below IE will shrink the table if I comment out some of the rows. Mozilla won't shrink the table. I tried using max-height but that doesn't seem to work. Any help would be greatly appreciated. Steve since@opendemand.com <html> <head>...
1
3602
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading child window height is 1200px (saying), when the child window load the height of the parent window changs but the backgorund color which is given 100% not fill the parent window. I have given my example codes, please give a solution as soon as...
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,...
0
9987
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
9023
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...
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
5424
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...
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
3
2910
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.