[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

pageXoffset

Posted on 2008-11-11
2
Medium Priority
?
264 Views
Last Modified: 2012-06-27
i just test a part of my script

<script type="text/javascript">
    document.write(window.pageXOffset)
</script>
 
and the result which was written to the page was 'undefined'.

is pageXoffset not valid?
0
Comment
Question by:Mr_Shaw
  • 2
2 Comments
 
LVL 15

Expert Comment

by:Tomarse111
ID: 22931692
Use document.body.scrollLeft or document.body.scrollTop instead, replacing document.body as and when needed with another element.
0
 
LVL 15

Accepted Solution

by:
Tomarse111 earned 2000 total points
ID: 22931706
you can also use offsetTop and offsetLeft to help with elements within the body.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question