상세 컨텐츠

본문 제목

화면 확대 축소 zoom + -

본문

반응형
	var nowZoom = 100;
	function zoomIn() {
		nowZoom = nowZoom - 10;
		if(nowZoom <= 70) nowZoom = 70;
		zooms();
	}


	function zoomOut() {
			nowZoom = nowZoom + 20;
			if(nowZoom >= 500) nowZoom = 500;
			zooms();
	}
	
	function zoomReset(){
		nowZoom = 100; 
		zooms();
	}
	
	function zooms(){

		$("body").css("zoom",nowZoom1);
		//또는
		//document.body.style.zoom = nowZoom + '%';
	
		if(nowZoom==70){
			alert ("30% 축소 되었습니다. 더 이상 축소할 수 없습니다.");
		}
		
		if(nowZoom==500){
			alert ("500% 확대 되었습니다. 더 이상 확대할 수 없습니다.");
		}
	}
반응형

관련글 더보기