473,394 Members | 1,697 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.

In java script it there a way to find out the size of a layer?

Is there some code you can use to find out the size of a layer? Not the offset i know how to do this what im looking for is a way to determan the size of the layer in pixels without it being set by css script my layer is
Expand|Select|Wrap|Line Numbers
  1. #PricePop {
  2.     position:absolute;
  3.     z-index:1;
  4.     visibility: hidden;
  5. }
  6.  
the layer is set possitioned by my code already i just need to know how to get the hight and width of the layer after the continince are filled in by php
thank you in advance
Aug 29 '07 #1
3 975
markrawlingson
346 Expert 100+
Try this...

Expand|Select|Wrap|Line Numbers
  1.  
  2. var oObj = document.getElementById('idofyourlayer');
  3. iHeight = oObj.style.height;
  4. iWidth = oObj.style.width;
  5.  
  6.  
Sincerely,
Mark
Aug 29 '07 #2
Try this...

Expand|Select|Wrap|Line Numbers
  1.  
  2. var oObj = document.getElementById('idofyourlayer');
  3. iHeight = oObj.style.height;
  4. iWidth = oObj.style.width;
  5.  
  6.  
Sincerely,
Mark
Nope i tryed it like so
Expand|Select|Wrap|Line Numbers
  1. var oObj = document.getElementById('ItemPop');
  2. alert(oObj.style.height);
  3.  
and nothing came thogh the alert box it was just a empty box
Aug 30 '07 #3
mrhoo
428 256MB
Expand|Select|Wrap|Line Numbers
  1. function elementSize(hoo) {
  2.     return [Math.max(hoo.scrollWidth, hoo.offsetWidth),
  3.     Math.max(hoo.scrollHeight, hoo.offsetHeight)];
  4. }
Aug 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

73
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
13
by: Yousuf Khan | last post by:
Hi, I have this pre-built JS routine that creates a text animation special-effect. The routine was included inside a freeware HTML editor, called AceHTML. The problem is that it seems to work only...
3
by: P Wolpert | last post by:
This is my first post. I hope I don't sound stupid. I have a script conflict when I put two scripts on one page. Both scripts will work if I use one at a time but the menu button script will not...
3
by: Peter.Smith1981 | last post by:
Dear All, I've a problem , that was when I creat web page,many script cannot load on same layer.One script onload, last line the </body>. So that I've find any way , but... So you point out...
0
by: Paul | last post by:
Hi I have a java script that uses a text variable and changes text color at an adjustable rate. I was trying to change the font size and font position of this but did not seem to work. Currently...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
2
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
29
by: s0suk3 | last post by:
Hello, I was hoping to get some opinions on a subject. I've been programming Python for almost two years now. Recently I learned Perl, but frankly I'm not very comfortable with it. Now I want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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.