In diesem Artikel wird die Methode der JS -Implementierung beschrieben, um Webfenster von der Mitte nach oben und unten zu erweitern. Teilen Sie es für Ihre Referenz. Die spezifische Analyse ist wie folgt:
Diese Seite wird aus der Mitte angezeigt und erweitert langsam auf und ab, was nicht schlecht ist. Der Code lautet wie folgt:
Kopieren Sie den Code wie folgt: <html>
<kopf>
<titels> js zeigt das Webfenster der erweiterten Mitte </title> an
<Styles>
<!-
.intro {
Position: absolut;
links: 0;
Top: 0;
Layer-Background-Color: Gelb;
Hintergrundfarbe:#336699;
Grenze: 0,1px Feststoff #336699
}
->
</style>
</head>
<body>
<div id = "i1"> </div> <div id = "i2"> </div>
<script Language = "JavaScript1.2">
var speed = 20
var temp = new Array ()
var temp2 = new Array ()
if (document.layers) {
für (i = 1; i <= 2; i ++) {
temp [i] = eval ("document.i"+i+". clip")
temp2 [i] = eval ("document.i"+i)
temp [i] .width = window.innnerwidth
temp [i] .height = window.innerHeight/2
temp2 [i] .top = (i-1)*temp [i] .height
}
}
sonst if (document.all) {
var clipbottom = document.body.offseteight/2, cliptop = 0
für (i = 1; i <= 2; i ++) {
temp [i] = eval ("document.all.i"+i+". Stil")
temp [i] .width = document.body.clientwidth
temp [i] .height = document.body.offseteight/2
temp [i] .top = (i-1)*parsesint (temp [i] .height)
}
}
Funktion openit () {
Fenster.Scrollto (0,0)
if (document.layers) {
Temp [1] .Bottom- = Geschwindigkeit
temp [2] .top+= Geschwindigkeit
if (temp [1] .bottom <= 0)
ClearInterval (Stopit)
}
sonst if (document.all) {
clipbottom- = Geschwindigkeit
temp [1] .clip = "rect (0 auto+"+clipbottom+"0)"
Cliptop+= Geschwindigkeit
temp [2] .clip = "rect ("+cliptop+"auto auto)"
if (clipbottom <= 0)
ClearInterval (Stopit)
}
}
Funktion gogo () {
stopit = setInterval ("openit ()", 100)
}
Gogo ()
</script>
</body>
</html>
Ich hoffe, dieser Artikel wird für alle Go -Sprachprogramme hilfreich sein.