-
-
Save JeongInyoung/89dfed990761144dcca0328d40036f48 to your computer and use it in GitHub Desktop.
화면 비율 계산기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<title>Document</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" charset="utf-8"></script> | |
<script type="text/javascript"> | |
<!-- // | |
$(function(){ | |
$('input[type="submit"]:eq(0)').on('click', function(event){ | |
event.preventDefault(); | |
var a = $('#a').val(); | |
var stringC = $('input[type="radio"]:checked').val().split('|'); | |
var b = parseInt(( a / stringC[0] ) * stringC[1]); | |
$('#b').val(b); | |
}); | |
$('input[type="submit"]:eq(1)').on('click', function(event){ | |
event.preventDefault(); | |
var b = $('#b').val(); | |
var stringC = $('input[type="radio"]:checked').val().split('|'); | |
var a = parseInt(( b / stringC[1] ) * stringC[0]); | |
$('#a').val(a); | |
}); | |
}); | |
// --> | |
</script> | |
</head> | |
<body> | |
<form> | |
<p> | |
<label><input type="radio" class="radio" name="group_radio" id="radio_1" checked="checked" value="16|9" />16:9</label> | |
<label><input type="radio" class="radio" name="group_radio" id="radio_2" value="16|10" />16:10</label> | |
<label><input type="radio" class="radio" name="group_radio" id="radio_3" value="6|4" />6:4</label> | |
<label><input type="radio" class="radio" name="group_radio" id="radio_4" value="4|3" />4:3</label> | |
</p> | |
<p> | |
<label>가로 <input type="text" id="a" class="txt" value="720" /></label> | |
<input type="submit" id="submit" class="txt" value="가로 기준 계산" /> | |
</p> | |
<p> | |
<label>세로 <input type="text" id="b" class="txt" value="720" /></label> | |
<input type="submit" id="submit" class="txt" value="세로 기준 계산" /> | |
</p> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment