my cell phone apparently doesn't support JQuery 이래로, 내가 수행 한 간단한 Javascript 테스트를 실행합니다. 다음 JQuery 코드를 표준 자바 스크립트으로 변환하려면 어떻게해야합니까?이 jquery 코드를 표준 javascript로 변환하는 방법은 무엇입니까?
기본 사항이 있어야합니다. 기능을 클릭하면 숨기기/클릭하여 표시됩니다.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="javascript/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("div > div.question").mouseover(function() {
if($(this).next().is(':hidden')) {
$(this).next().show();
} else {
$(this).next().hide();
}
});
});
</script>
<style>
div.flashcard {
margin: 0 10px 10px 0;
}
div.flashcard div.question {
background-color:#ddd;
width: 400px;
padding: 5px;
cursor: hand;
cursor: pointer;
}
div.flashcard div.answer {
background-color:#eee;
width: 400px;
padding: 5px;
display: none;
}
</style>
</head>
<body>
<div id="1" class="flashcard">
<div class="question">Who was Wagner?</div>
<div class="answer">German composer, conductor, theatre director and essayist.</div>
</div>
<div id="2" class="flashcard">
<div class="question">Who was Thalberg?</div>
<div class="answer">a composer and one of the most distinguished virtuoso pianists of the 19th century.</div>
</div>
</body>
</html>
Worked!
감사합니다. bobince!
alt text http://www.deviantsart.com/upload/o61pba.jpg
에서
라이브 또 다른 자세한 답변을, 당신은을 만들 수 있습니다 기능 (귀하의 휴대 전화가 지원하는 지 확실하지 않은 경우 ... smth like : function showhideme (element) { element.style.display = element.style.display = = ''? '없음': ''; } ...
– Nick