메뉴 건너뛰기

조회 수 12648 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
<head>

    <script type="text/javascript"> 

        function resizeImg(osrc) 

        { 

            var bdiv =document.createElement('DIV'); 

            document.body.appendChild(bdiv); 

            bdiv.setAttribute("id", "bdiv"); 

            bdiv.style.position = 'absolute'; 

            bdiv.style.top = 0; 

            bdiv.style.left = 0; 

            bdiv.style.zIndex = 0; 

            bdiv.style.width = document.body.scrollWidth; 

            bdiv.style.height = document.body.scrollHeight; 

            bdiv.style.background = 'gray'; 

            //bdiv.style.filter = "alpha(opacity=75)";

            bdiv.style.opacity = '0.5';

            //bdiv.style.mozOpacity = '0.5';

            var odiv = document.createElement('DIV'); 

            document.body.appendChild(odiv); 

            odiv.style.zIndex = 1; 

            odiv.setAttribute("id", "odiv"); 

            odiv.innerHTML = "<a href='javascript:void(closeImg())'><img id='oimg' src='"+osrc+"' border='0' /></a>"; 

            var img = document.all['oimg']; 

            var owidth = (document.body.clientWidth)/2 - (img.width)/2; 

            var oheight = (document.body.clientHeight)/2 - (img.height)/2; 

            odiv.style.position = 'absolute'; 

            odiv.style.top = oheight + document.body.scrollTop; 

            odiv.style.left = owidth; 

            scrollImg(); 

        }

        function resizeImg2(osrc) 

        { 

            var bdiv =document.createElement('DIV'); 

            document.body.appendChild(bdiv); 

            bdiv.setAttribute("id", "bdiv"); 

            bdiv.style.position = 'absolute'; 

            bdiv.style.top = 0; 

            bdiv.style.left = 0; 

            bdiv.style.zIndex = 0; 

            bdiv.style.width = document.body.scrollWidth; 

            bdiv.style.height = document.body.scrollHeight; 

            bdiv.style.background = 'gray'; 

            //bdiv.style.filter = "alpha(opacity=75)";

            bdiv.style.opacity = '0.5';

            //bdiv.style.mozOpacity = '0.5';

            var odiv = document.createElement('DIV'); 

            document.body.appendChild(odiv); 

            odiv.style.zIndex = 1; 

            odiv.setAttribute("id", "odiv"); 

            odiv.innerHTML = "<a href='javascript:void(closeImg())'><img id='oimg' src='"+osrc+"' border='0' width='700' height='400'/></a>"; 

            var img = document.all['oimg']; 

            var owidth = (document.body.clientWidth)/2 - (img.width)/2; 

            var oheight = (document.body.clientHeight)/2 - (img.height)/2; 

            odiv.style.position = 'absolute'; 

            odiv.style.top = oheight + document.body.scrollTop; 

            odiv.style.left = owidth; 

            scrollImg(); 

        }

        function scrollImg() 

        { 

            var odiv = document.all['odiv']; 

            var img = document.all['oimg']; 

            var oheight = (document.body.clientHeight)/2 - (img.height)/2 + document.body.scrollTop; 

            odiv.style.top = oheight; 

            settime = setTimeout(scrollImg, 100); 

        } 

        function closeImg() 

        { 

            document.body.removeChild(odiv); 

            document.body.removeChild(bdiv); 

            clearTimeout(settime); 

        } 

    </script> 

</head> 

<body>

<div>

<img src="/images/15.jpg" height="200" width="300" onclick="resizeImg(this.src)" />

</div>

<br>

<br>

<img src="/images/15s.jpg" height="200" width="300" onclick="resizeImg2(this.src)" />

<br>

<br>

<img src="/images/15.jpg"/>

</body>

 


List of Articles
번호 제목 날짜 조회 수
139 간단한 스크롤 따라 움직이는 메뉴 만들기 2021.03.26 727
138 JS 타이머 샘플 2019.06.04 745
137 새창(자식창) 제어하기, 새창 POST방식으로 값 넘기기 2021.03.26 787
136 JS 날짜 자료 비교 2019.06.04 788
135 DateTimepicker ( Timepicker + Datepicker ) file 2021.03.26 788
134 체크박스 전체선택/해지 2019.06.04 790
133 //ex)텍스트 박스 포커스 활성, 비활성 이벤트 2019.06.04 812
132 click event scroll 2021.03.31 827
131 정규식, 한글 못쓰게 하기, replace all 2021.03.26 844
130 jQuery 일반적 팁 2019.06.04 853
129 텍스트 필드에 기본글이 마우스 클릭하면 지워지게 하기 폼필드 소스 내에 아래 태그를 삽입한다. 2019.06.04 867
128 jQuery 로 탭메뉴 2019.01.10 938
127 .attr() : 태그의 속성 값을 읽어오거나 속성을 추가및 재설정 2019.01.16 962
126 이미지 확대/축소 2020.11.25 974
125 .removeAttr() : 특정 속성을 제거 2019.01.16 1021
124 jQuery 로 원하는 갯수만큼 checkbox 선택하기 2019.01.10 1022
123 jQuery 기초 (JQuery - text(), val(), html(), attr(), prop()) 2019.01.16 1055
122 jQuery 기초 (Query link url / download (위치, 사용법) // p태그, id, class 접근 / 일반태그 가져오기 / 클릭시 값) 2019.01.16 1079
121 jQuery 기초 ((문자열 추가 .before / .after) (문자열 삭제 .remove / .empty) file 2019.01.16 1084
120 jQuery 로 해보는 체크박스(checkbox) 전체선택, 선택해제 예제 2019.01.10 1085
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved