HTML&CSS | 화면 확대기 기능
페이지 정보
작성자 굿스웹 작성일19-01-09 17:04 조회966회 댓글0건관련링크
본문
<html>
<head>
<script language="javascript" type="text/javascript">
<!-- 화면 확대 축소 시작 IE 전용 --->
<!--
var nowZoom = 100; // 현재비율
var maxZoom = 200; // 최대비율(500으로하면 5배 커진다)
var minZoom = 80; // 최소비율
//화면 키운다.
function zoomIn()
{
if (nowZoom < maxZoom)
{
nowZoom += 10; //25%씩 커진다.
}
else
{
return;
}
document.body.style.zoom = nowZoom + "%";
}
//화면 줄인다.
function zoomOut()
{
if (nowZoom > minZoom)
{
nowZoom -= 10; //25%씩 작아진다.
}
else
{
return;
}
document.body.style.zoom = nowZoom + "%";
}
//화면 원래대로
function zoomDefault()
{
nowZoom = 100;
document.body.style.zoom = nowZoom + "%";
}
//-->
<!-- 화면 확대 축소 끝 --->
</script>
</head>
<body>
<h6>~~난 글씨가 작아~~~ㅜㅠ 안보여~~!!</h6><br>
<input type="button" value="확대+" onclick="zoomIn();"><br>
<input type="button" value="축소-" onclick="zoomOut();"><br>
<input type="button" value="원래" onclick="zoomDefault();">
</body>
</html>
<head>
<script language="javascript" type="text/javascript">
<!-- 화면 확대 축소 시작 IE 전용 --->
<!--
var nowZoom = 100; // 현재비율
var maxZoom = 200; // 최대비율(500으로하면 5배 커진다)
var minZoom = 80; // 최소비율
//화면 키운다.
function zoomIn()
{
if (nowZoom < maxZoom)
{
nowZoom += 10; //25%씩 커진다.
}
else
{
return;
}
document.body.style.zoom = nowZoom + "%";
}
//화면 줄인다.
function zoomOut()
{
if (nowZoom > minZoom)
{
nowZoom -= 10; //25%씩 작아진다.
}
else
{
return;
}
document.body.style.zoom = nowZoom + "%";
}
//화면 원래대로
function zoomDefault()
{
nowZoom = 100;
document.body.style.zoom = nowZoom + "%";
}
//-->
<!-- 화면 확대 축소 끝 --->
</script>
</head>
<body>
<h6>~~난 글씨가 작아~~~ㅜㅠ 안보여~~!!</h6><br>
<input type="button" value="확대+" onclick="zoomIn();"><br>
<input type="button" value="축소-" onclick="zoomOut();"><br>
<input type="button" value="원래" onclick="zoomDefault();">
</body>
</html>
[주소복사] https://www.goodsweb.kr/?u=D412yd3Y
SNS 알리기
핀터레스트
텔레그램로
블로그로
페이스북
트위터
카카오스토리
카톡 공유
관련 블로그
로딩중