JS couplets that comply with W3C standards

Source: Internet
Author: User





standard-compliant couplet ads

// Alert (diffy );
Percent =. 1 * (diffy-lastscrolly );
If (percent> 0) percent = math. Ceil (percent );
Else percent = math. Floor (percent );
Document. getelementbyid ("leftdiv"). style. Top = parseint (document. getelementbyid ("leftdiv"). style. Top) + percent + "PX ";
Document. getelementbyid ("rightdiv"). style. Top = parseint (document. getelementbyid ("leftdiv"). style. Top) + percent + "PX ";

Lastscrolly = lastscrolly + percent;
// Alert (lastscrolly );
}

// After the following paragraph is deleted, the couplet will not move along with the screen.
Window. setinterval ("Heartbeat ()", 1 );
// -->
</SCRIPT>

<Style type = "text/CSS">
<! --
/* The page height is defined here. It is used to test the effect of the couplet following, and has nothing to do with advertising */
HTML, body {Height: 1000px ;}
# Mm {Height: 1000px ;}

/* Set couplet style drops */
# Leftdiv, # rightdiv {
Width: 120px;/* width */
Height: 250px;/* height */
Background-color: # e5e5e5;/* Background Color */
Border: 1px solid # DDD;/* border style */
Position: absolute;/* absolute positioning activation */
}
-->
</Style>
</Head>

<Body>

<Div id = "leftdiv" style = "Top: 120px;/* 120px from top */left: 2px; /* 2 px from the left */"> advertisement content on the left </div>
<Div id = "rightdiv" style = "Top: 120px;/* 120px from top */right: 2px; /* 2 PX */"> right ad content </div>

<Div id = "mm">
</Div>
</Body>
</Html>

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.