473,471 Members | 1,981 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Error parsing value for property 'top'

Tom
I have a function which finds the x and y coordinate of any object in
the document by referring to offsetLeft or offsetTop value of the
object's offsetParent, all the way to the top of the DOM, i.e.:

function get_y(obj) {
var coord = 0;
while (obj.offsetParent) {
coord += obj.offsetTop;
obj = obj.offsetParent;
}
return coord;
}

function get_x(obj) {
/* same as above function, but with offsetLeft in place of offsetTop
*/
}

Now, I've tested this function out many, many times on documents built
using table models, and it works perfectly. However, I tried to import
the same function to a document using a CSS model without any tables
and it fails on the y-coord function ONLY -- the x-coord function
(offsetLeft) works just as it would on a document using the table
model, but the y-coord function produces the following error in a CSS
model:

"Line 0: Error parsing value for property 'top'; Declaration dropped"
(moz error -- IE returns "Invalid argument Line 0")

I'm unable to figure out what the problem is. I'm assuming I've left
out a certain required parameter in my stylesheet, but I don't know
what it could be!

Any insight would be appreciated!

Oct 10 '06 #1
2 10336


Tom wrote:

"Line 0: Error parsing value for property 'top'; Declaration dropped"
(moz error
That error message is given by Mozilla's CSS parser and essentially
means that you/your stylesheet(s) give an incorrect value for the CSS
top property e.g. instead of having
top: 20px;
you might have only
top: 20;
which is not correct CSS. So check your stylesheet or your script
setting the CSS top property to supply a proper CSS value (i.e. number
plus unit).

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 10 '06 #2
Tom
That error message is given by Mozilla's CSS parser and essentially
means that you/your stylesheet(s) give an incorrect value for the CSS
top property e.g. instead of having
top: 20px;
you might have only
top: 20;
which is not correct CSS. So check your stylesheet or your script
setting the CSS top property to supply a proper CSS value (i.e. number
plus unit).
Which object though? I don't have the top property defined anywhere in
my stylesheet (all the elements are floating).

The function successfully finds the offsetTop for all div elements, but
somewhere near the top of the DOM this error pops up. The fact that
position is not defined anywhere doesn't seem to affect the function's
ability to get the offsetLeft value, but it does for offsetTop. Any
thoughts?

Oct 10 '06 #3

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

Similar topics

21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
9
by: torbs | last post by:
Hi I am creating a page for stretchfilm. In this page you can chose between a short medium and long version of the film at any point in the film. It is in norwegian, but just press play. URL:...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
6
by: ST | last post by:
Hi, I keep getting the parser error, and I have no idea why. I've tried a number of things including: 1)building/rebuilding about 100x 2)making sure all dll's are in the bin folder in the root...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
1
by: giangiammy | last post by:
hi all, switching from firefox 1.07 to 1.5.0.3 (linux version) I got errors on a javascript page: error in parsing value for property 'visibility'. Declaration dropped. the proble should be...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
0
by: poojamangal | last post by:
I want to upload images or pdf files. but i m unable to do so. i got error. please help me to sort it out.. my code is: <% 'on error resume next Class FreeASPUpload Public UploadedFiles...
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
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,...
1
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...
0
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
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.