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

How far div is from top of window

I have a div inside a table cell, which is about half-way down the
page. Is there a javascript property that returns the offset between
the div and the top of the page? I tried a few different things from a
google search with no success.

Thanks,
Mike

Jul 7 '06 #1
4 1443
I tried this:
http://groups.google.com/group/comp....8308ba25271960

But the code doesn't work in Firefox 1.5.

Mike
afrinspray wrote:
I have a div inside a table cell, which is about half-way down the
page. Is there a javascript property that returns the offset between
the div and the top of the page? I tried a few different things from a
google search with no success.

Thanks,
Mike
Jul 7 '06 #2
afrinspray wrote:
I have a div inside a table cell, which is about half-way down the
page. Is there a javascript property that returns the offset between
the div and the top of the page?
No, not directly. But the lib here will do all the required calculations for
you:
http://www.javascripttoolbox.com/lib/objectposition/

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Jul 7 '06 #3
Perfect thanks!

Matt Kruse wrote:
afrinspray wrote:
I have a div inside a table cell, which is about half-way down the
page. Is there a javascript property that returns the offset between
the div and the top of the page?

No, not directly. But the lib here will do all the required calculations for
you:
http://www.javascripttoolbox.com/lib/objectposition/

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Jul 10 '06 #4

afrinspray wrote:
I have a div inside a table cell, which is about half-way down the
page. Is there a javascript property that returns the offset between
the div and the top of the page? I tried a few different things from a
google search with no success.

Thanks,
Mike
Dear sir,
Do you have the page with a relative positioning, or absolute. In the
case of absolute, you would know this right away by accessing the top
attribute of the div. Otherwise, I do not know how.

I have the honor to remain your most humble and Ob't Sv't in our war
against the King.

--
Patrick Reilly
1st Coy.
Colonel Seth Warner's Regiment

Jul 10 '06 #5

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

Similar topics

0
by: |-|erc | last post by:
Hi! Small challenge for you. The index.php uses this file and calls layout(). Take a look at www.chatty.net this file draws the chat login box on the right. I traced the CHAT button it submits...
2
by: Davide Bruzzone | last post by:
Greetings all... Here's a description of the problem that I'm trying to solve: - I have a Web page from which users can open one or more other windows. - From that web page, the user can then...
2
by: Juan Garcia | last post by:
Subject says it all. Given: Window A with text field. Window B with a button (onClick opens Window C) Window C with a button (onClick I want it to modify text fields of Window A) I have...
13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
3
by: Dale | last post by:
I'm using the NotifyIcon component on a form within a Windows application that will normally show no interface. NotifyIcon does add an icon as required to the notification area of the Task Bar. ...
4
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a...
2
by: Cheryl | last post by:
Hi, I have encounter a problem.Language use is C#. I would like to open a new window (is a modal window, where I m not able to switch from parent window after this window is open)from the parent...
2
by: M B HONG 20 | last post by:
Hi all - I am working on a web application and have run into a problem. From a main window (Window1) I open a child window (Window2), and from that child window I open a grandchild window...
6
by: paul | last post by:
HI! How do we send a variable from an Iframe page back to its parent? I have a script that calculates the iframe's window size but I need to know how to send that value back to its parent so I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.