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

HTML document.body.scrollTop question

Hi all,
I created a complex ASPX page, nested inside a master page and Ajax
UpdatePanel. In one of my Javascript function I need to capture mouse
position. I use alert(document.body.scrollTop) to test scroll bar position.
Even though I have a long scroll bar and already to end of the page, when I
call this function, I always get "0" as document.body.scrollTop.

Meanwhile I created a very simple HTML page with a lot of <brto test, it
works fine. I tried both IE6 and IE7, no luck at all.

My question is under what situation document.body.scrollTop always returns 0
in IE?
--
Regards
Hardy
Feb 22 '07 #1
2 14629
After some tries, if I remove

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Then it works fine! Any idea how can I make it work with XHTML 1.0?
--
Regards
Hardy
"Hardy Wang" wrote:
Hi all,
I created a complex ASPX page, nested inside a master page and Ajax
UpdatePanel. In one of my Javascript function I need to capture mouse
position. I use alert(document.body.scrollTop) to test scroll bar position.
Even though I have a long scroll bar and already to end of the page, when I
call this function, I always get "0" as document.body.scrollTop.

Meanwhile I created a very simple HTML page with a lot of <brto test, it
works fine. I tried both IE6 and IE7, no luck at all.

My question is under what situation document.body.scrollTop always returns 0
in IE?
--
Regards
Hardy
Feb 22 '07 #2
use w3c syntax:

document.documentElement.scrollTop
-- bruce (sqlwork.com)

Hardy Wang wrote:
After some tries, if I remove

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Then it works fine! Any idea how can I make it work with XHTML 1.0?
Feb 23 '07 #3

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

Similar topics

12
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
4
by: Jake j | last post by:
To those of you who sent me working examples of js include routines, much thanks. I see from them examples that what I'm trying to get to requires a higher level of js knowledge than I've got. ...
7
by: dd | last post by:
Hello all. First, I'm a newbie to javascript but not to ASP. Secondly I've been searching for the answer for two hours and I decided to finally post this question. I'm trying to take a...
6
by: Ashok | last post by:
Hi, I am starting a new project to build a software product using APS.NET 2.0. In past I have used "frameset" and "frame" to build pages. My current requirements I have coded using frameset and...
5
by: sam | last post by:
Hi all, I am using documnet.body.scroll to disable the window scroll bar. This works in IE only and not other browsers. Can any one tell me if there is any such method which is cross browser...
1
by: Jefferds.A | last post by:
Hi, I'm putting together a little database of individuals categorized by family. I have two lists, one that contains family names and one that contains individuals' names. When you click on a link...
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
2
by: davidson1 | last post by:
Hai friends..for menu to use in my website..i found in one website....pl look below website.... http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm i downloaded 2 files.... ...
8
mikek12004
by: mikek12004 | last post by:
1) Script Title: Rich HTML Balloon Tooltip 2) Script URL :http://www.dynamicdrive.com/dynamicindex5/balloontooltip.htm 3) Problem Description: See this page General Music for links you can...
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.