Js implements the animation Switching Effect of green and white vertical web page blinds and vertical blinds

Source: Internet
Author: User

Js implements the animation Switching Effect of green and white vertical web page blinds and vertical blinds

The example in this article describes how js achieves green and white vertical webpage shutter animation switching. Share it with you for your reference. The specific analysis is as follows:

We have explained a webpage shutter switching animation effect, but it is a horizontal Louver. This is a vertical louver, and the code is basically the same:
Copy codeThe Code is as follows: <Head>
<Title> shutter page switching effect </title>
<Style>
<! --
. Intro {
Position: absolute;
Left: 0;
Top: 0;
Layer-background-color: green;
Background-color: green;
Border: 0.1px solid green
}
-->
</Style>
</Head>
<Body>
<Div id = "i1" class = "intro"> </div> <div id = "i2" class = "intro"> </div> <div id = "i3"
Class = "intro"> </div> <div id = "i4" class = "intro"> </div> <div id = "i5" class = "intro"> </div> <div
Id = "i6" class = "intro"> </div> <div id = "i7" class = "intro"> </div> <div id = "i8" class = "intro"> </div>
<Script language = "JavaScript1.2">
Var speed = 20
Var temp = new Array ()
Var temp2 = new Array ()
If (document. layers ){
For (I = 1; I <= 8; I ++ ){
Temp [I] = eval ("document. I" + I + ". clip ")
Temp2 [I] = eval ("document. I" + I)
Temp [I]. width = window. innerWidth/8-0.3
Temp [I]. height = window. innerHeight
Temp2 [I]. left = (I-1) * temp [I]. width
}
}
Else if (document. all ){
Var clipbottom = document. body. offsetHeight, cliptop = 0
For (I = 1; I <= 8; I ++ ){
Temp [I] = eval ("document. all. I" + I + ". style ")
Temp [I]. width = document. body. clientWidth/8
Temp [I]. height = document. body. offsetHeight
Temp [I]. left = (I-1) * parseInt (temp [I]. width)
}
}
Function openit (){
Window. scrollTo (0, 0)
If (document. layers ){
For (I = 1; I <= 8; I = I + 2)
Temp [I]. bottom-= speed
For (I = 2; I <= 8; I = I + 2)
Temp [I]. top + = speed
If (temp [2]. top> window. innerHeight)
ClearInterval (stopit)
}
Else if (document. all ){
Clipbottom-= speed
For (I = 1; I <= 8; I = I + 2 ){
Temp [I]. clip = "rect (0 auto +" + clipbottom + "0 )"
}
Cliptop + = speed
For (I = 2; I <= 8; I = I + 2 ){
Temp [I]. clip = "rect (" + cliptop + "auto )"
}
If (clipbottom <= 0)
ClearInterval (stopit)
}
}
Function gogo (){
Stopit= setInterval ("openit ()", 100)
}
Gogo ()
</Script>
</Body>
</Html>

I hope this article will help you design javascript programs.

Related Article

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.