javascript, jquery

jquery 체크박스 체크 후 해당 위치로 이동

디츠 2014. 9. 27. 15:09
<script>
function agree() {
	if($("#agree").is(":checked") == true) {
		$(".support_form").fadeIn();
		var target_offset = $("#agree").offset();
		var target_top = target_offset.top;
		$('html, body').animate({scrollTop:target_top}, 500);
	} else {
		$(".support_form").fadeOut();
	}
}

$(document).ready(function() {
	$(".support_form").hide();
});
</script>