이것은 질문을위한 많은 양의 코드이지만, 기본적으로이 코드는 작동하고 있었다. 누구든지 문제를 발견 할 수 있습니까? 실제로 부부가있을 수 있습니다.Jquery는 값을 비교하여 깨어났다.
기본적으로 jquery를 배우는 것만으로도 입력 값을 얻고 싶습니다. 사용자가 비교를 클릭하면 천천히 응답 그래프를 작성한 다음 미리 설정된 "평균"응답과 동일하게 수행합니다 결국 대답과 평균의 차이점을 알려줄 것입니다.
<h2 id="compare">Compare your score with the average</h2>
<p><a href="#compare" class="run">Compare</a></p>
<div style="height:400px;position:relative;">
<div id="score" style="position:absolute;left:0px;bottom:0px;width:200px;height:2px;background-color:#01DFD7;float:left;"></div>
<div id="score2" style="position:absolute;left:220px;bottom:0px;width:200px;height:2px;background-color:#FFD;float:left;"></div>
</div>
<input id="yourValue" type="text" />
<p id="answer"></p>
<script type="text/javascript">
$('.run').click(function(){
var theValue = $("#yourValue").val();
$('#score').animate({height:'theValue'}, 5000, function(){
$('#score2').animate({height:'200px'}, 5000, function(){
$('#answer#).html("<p>Your Answer: </p>" + theValue);
});
});
});
</script>
좋아요, 100 명의 담당자없이 답할 수는 없지만 문제가있는 것으로 나타났습니다 $ ('# 답변') .html ('
귀하의 답변 :
'+ theValue); 은 다음과 같아야합니다. $ ('# 답변') .html ('응답 :'+ theValue); 나는 왜 누군가가 빛을 비출 수 있는지 잘 모른다. 그것은 크게 감사 할 것이다. – Wayneio$ ('# answer') .html ('
당신의 답변 :
'+ theValue); $ ('# answer')이어야합니다 .html ('Your Answer :'+ theValue); <- 위의 답변에서 복사하여 붙여 넣었으므로 단락 대신 굵게 표시하고 싶습니까? 그것이 유일한 차이점입니다. 귀하의 질문에 답변 한 이후로 답변을 승인 된 것으로 표시하십시오. 감사! – Jlam