ASPX page and onscroll event

Source: Internet
Author: User

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

This makes onscroll events unavailable for pages that comply with W3C standards, that is, onscroll events do not comply with W3C standards.

Many directly Delete the preceding statement and write it in the body as follows:

<Body onscroll ="

Floater. style. Top = Document. Body. scrolltop + document. Body. clientHeight-oip.offsetHeight;

">

<Div id = "floater"> </div>

Other attributes of floater, such as color, width, and height, can be written directly in CSS.

The result is that the onscroll event can be executed, but the structure of my page is disrupted due to the lack of the W3C standard. So... This cannot be used.

I use the following method:

<SCRIPT type = "text/JavaScript">
Function divmove ()
{

VaR floater = Document. getelementbyid ("floater"); // this can be done without writing.
Floater.style.top?document.documentelement.scrolltop=document.doc umentelement. clientHeight-floater.offsetHeight;
}
</SCRIPT>

BodyCodeIs

<Body onload = "window. setinterval (divmove, 150);">...

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.