- 웹 페이지를 위로 10픽셀 스크롤(마우스 스크롤 다운)

 

- 웹 페이지를 왼쪽으로 10픽셀, 아래로 15픽셀 스크롤(마우스 스크롤 업)

 

- 웹 페이지의 (0, 200) 좌표 부분이 현재 윈도우의 왼쪽 상단 모서리에 출력되도록 스크롤

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function startScroll(interval){
            setInterval('autoScroll()', interval);
        }
        function autoScroll(){
            window.scrollBy(0,10);//10픽셀 위로 올라감
        }
    </script>
</head>
<body onload="startScroll(1000)">
    <h3>자동 스크롤 페이지</h3>
<hr>
<h3>꿈길(이동순)</h3>
꿈길에<br>
발자취가 있다면<br>
님의 집 창밖<br>
그 돌계단 길이 이미 오래 전에<br>
모래가 되고 말았을 거예요<br><br>
하지만<br>
그 꿈길에서 자취 없다 하니<br>
나는 그것이 정말 서러워요<br><br>
이 밤도<br>
나는 님의 집 창밖<br>
그 돌계단 위에 홀로 서서<br>
혹시라도 님의 목소리가 들려올까<br>
고개 숙이고 엿들어요<br>
</body>
</html>
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs

- 페이지 자동 스크롤 예시

'화면구현' 카테고리의 다른 글

history 객체  (0) 2020.03.16
location 객체  (0) 2020.03.16
window 객체의 타이머 활용  (0) 2020.03.16
윈도우 열기  (0) 2020.03.16
계산기 만들기  (0) 2020.03.12
openclose