В этой статье описывается метод реализации JS для расширения веб -окнов от середины до верхней и нижней. Поделитесь этим для вашей ссылки. Конкретный анализ заключается в следующем:
Эта страница отображается из среднего и медленно расширяющегося вверх и вниз, что неплохо, код заключается в следующем:
Скопируйте код следующим образом: <html>
<голова>
<title> JS отображает веб -окно расширенного среднего </title>
<style>
<!-
.intro {
позиция: абсолютно;
слева: 0;
Верх: 0;
Слои-громкий цвет: желтый;
фоновый цвет:#336699;
Граница: 0,1px твердое вещество #336699
}
->
</style>
</head>
<тело>
<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) {
for (i = 1; i <= 2; i ++) {
temp [i] = eval ("document.i"+i+". clip")
temp2 [i] = eval ("document.i"+i)
Temp [i] .width = window.innerwidth
Temp [i] .height = window.innerheight/2
temp2 [i] .top = (i-1)*temp [i]
}
}
еще if (document.all) {
var clipbottom = document.body.offsetheight/2, cliptop = 0
for (i = 1; i <= 2; i ++) {
temp [i] = eval ("document.all.i"+i+". Style")
temp [i] .width = document.body.clientWidth
temp [i] .height = document.body.offsetheight/2
temp [i] .top = (i-1)*parseint (temp [i].
}
}
функция openit () {
window.scrollto (0,0)
if (document.layers) {
темп [1] .bottom- = скорость
темп [2] .top+= скорость
if (temp [1] .bottom <= 0)
ClearInterval (Stopit)
}
еще if (document.all) {
clipbottom- = скорость
temp [1] .clip = "rect (0 auto+"+clipbottom+"0)"
cliptop+= скорость
Temp [2] .clip = "rect ("+cliptop+"Auto Auto)"
if (clipbottom <= 0)
ClearInterval (Stopit)
}
}
функция gogo () {
Stopit = setInterval ("openit ()", 100)
}
gogo ()
</script>
</body>
</html>
Я надеюсь, что эта статья будет полезна для языкового программирования всех.