1
토글 가시성 div가 있고 테이블 외부에서 작동하지만 내부에는 토글되지 않습니다. 어떤 도움이 필요합니까?테이블 외부에서 작업하지 않고 토글합니다.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.4.js"></script>
<style type="text/css">
#hidden{
background-color:gray;
width:120px;
text-decoration:none;
font-size:x-large;
top:120px;
color:black;
display:none;
border:thin;
border-bottom-color:gray;
}
.style1 {
border-style: solid;
border-width: 1px;
}
.style2 {
border-width: 1px;
}
</style>
</head>
<body>
<p id="button"><a href="#">Toggle</a></p>
<div id="hidden">woot</div>
<script>
$("#button").hover(function() {
$("#hidden").toggle();
});
</script>
<table style="width: 35%" cellspacing="1" class="style1">
<tr>
<td class="style2" style="width: 164px"><p id="button"><a href="#">Toggle</a></p>
</td>
<td class="style2"><div id="hidden">woot</div></td>
</tr>
<tr>
<td class="style2" style="width: 164px"> </td>
<td class="style2"> </td>
</tr>
</table>
</body>
</html>
감사를
을 그리고
$(".button")
에$("#button")
에서 선택을 변경하는 대신는 경우이 같은 여러 요소에 대한 클래스를 사용! – curious