이 기사에서는 웹 창을 중간에서 상단 및 하단으로 확장하기위한 JS 구현 방법에 대해 설명합니다. 참조를 위해 공유하십시오. 특정 분석은 다음과 같습니다.
이 페이지는 중간에서 표시되며 천천히 위아래로 확장되며, 나쁘지 않은 코드는 다음과 같습니다.
다음과 같이 코드를 복사하십시오. <html>
<헤드>
<title> js는 확장 된 중간 </title>의 웹 창을 표시합니다
<스타일>
<!-
.intro {
위치 : 절대;
왼쪽 : 0;
상단 : 0;
레이어 백-거지 색상 : 노란색;
배경색 :#336699;
국경 : 0.1px 고체 #336699
}
->
</스타일>
</head>
<body>
<div id = "i1"> </div> <div id = "i2"> </div>
<script language = "javaScript1.2">
var 속도 = 20
var temp = 새로운 배열 ()
var temp2 = 새로운 배열 ()
if (document.layers) {
for (i = 1; i <= 2; i ++) {
온도 [i] = eval ( "document.i"+i+". clip")
temp2 [i] = eval ( "document.i"+i)
온도 [i] .width = window.innerWidth
온도 [i] .height = window.innerheight/2
temp2 [i] .top = (i-1)*temp [i] .Height
}
}
else if (document.all) {
var clipbottom = document.body.offsetheight/2, cliptop = 0
for (i = 1; i <= 2; i ++) {
온도 [i] = eval ( "document.all.i"+i+". Style")
온도 [i] .width = document.body.clientWidth
온도 [i] .height = document.body.offsetheight/2
온도 [i] .top = (i-1)*parseint (temp [i] .height)
}
}
function openit () {
Window.scrollto (0,0)
if (document.layers) {
온도 [1] .bottom- = 속도
온도 [2] .top+= 속도
if (temp [1] .bottom <= 0)
ClearInterval (stopit)
}
else if (document.all) {
clipbottom- = 속도
온도 [1] .clip = "rect (0 auto+"+clipbottom+"0)" "
cliptop+= 속도
온도 [2] .clip = "rect ("+cliptop+"auto auto)"
if (clipbottom <= 0)
ClearInterval (stopit)
}
}
기능 gogo () {
stopit = setInterval ( "openit ()", 100)
}
고고 ()
</스크립트>
</body>
</html>
이 기사가 모든 사람의 이동 언어 프로그래밍에 도움이되기를 바랍니다.