Mobile phone screen flip

Source: Internet
Author: User

 
/**
You can control the data by yourself and set the specific meaning of the key.

*/
VaR currentpage = 1;
Function pageresult (PAGE ){
VaR Weight = 0;
VaR Height = 0;
// You can locate the horizontal display position.
// Var setweight = Document. Body. scrollheight/totlenum;
// Locate the direct direction of the tree and display data on several screens
// The size of each screen (availheight and availwidth are displayed based on the size of the screen)
VaR screenheight = Window. Screen. availheight;

// Display several screens (scrollwidth and scrollheight)
VaR setheight = Document. Body. scrollheight/screenheight; // (only supported after IE6)
// Var setheight=document.doc umentelement. scrollheight/screenheight; // different browsers are displayed.
// Yes, but there must be a uniform ID body.
// Var setheight = Document. getelementbyid ("body"). scrollheight/screenheight;
// Press the upper and lower right parts (2, 8, 4, 6)
// Flip the screen up and press the keyboard key of the phone 2 or press the Arrow
If (event. keycode = 38 | event. keycode = 104 ){
If (currentpage> 0 ){
Currentpage --;
}
Height = screenheight * currentpage;
}
// Flip down the screen and press the keyboard of the phone 8 or down the Arrow
If (event. keycode = 40 | event. keycode = 98 ){
If (currentpage <= setheight ){
Currentpage ++;
}
Height = screenheight * currentpage;
}
// Return to start 4 or left
If (event. keycode = 37 | event. keycode = 100 ){
Height = 0;
}

// End by arrow right or by 6
If (event. keycode = 39 | event. keycode = 102 ){
// Height = Document. getelementbyid ("body"). scrollheight;
Height = Document. Body. scrollheight;
// Height1_document.doc umentelement. scrollheight;
Alert (height );
}
If (event. keycode = 13 ){
Window. Location. href = "http://www.baidu.com ";
}
Window. scrollto (0, height );

}
// Load events by default after JS is imported
Required parameter Doc ument. onkeydown = pageresult;

 

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.