(In-line QQ scrolling document.doc umentelement. scrolltop and document. Body. scrolltop)

Source: Internet
Author: User

Online QQCode. You can scroll with the drop-down of the mouse.

But as long as there is <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> does not scroll.

This standard does not support writing certain attributes. In the past, the above line of code was removed, but some CSS styles were removed, and today I searched for nothing.

Find this articleArticle: Http://blog.csdn.net/tfgdd/archive/2010/01/12/5182033.aspx

 

The fixed layer location may be frequently used during page design. In this case, you need to obtain the coordinates of Some HTML objects to set the coordinates of the Target layer more flexibly. document may be used here. body. scrolltop and other attributes, but this attribute

On the XHTML standard webpage or, more simply, with <! Doctype...> the result of the tag page is 0. If you do not use this tag, everything is normal. How can you obtain the body coordinate on the XHTML page? Of course, there is a way-Use

Document.doc umentelement to replace document. Body, which can be written in this way

Example:
VaR Top = document.doc umentelement. scrolltop | document. Body. scrolltop;
| In Javascript is a good thing. Besides being able to be judged by conditions such as if, it can also be used to assign values to variables. The preceding example is equivalent to the following example.
Example:
VaR Top = document.doc umentelement. scrolltop? Document.doc umentelement. scrolltop: Document. Body. scrolltop;
This write can be well compatible.

In contrast, if you do not declare it, document.doc umentelement. scrolltop is displayed as 0.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.