DB에서 내용을 동적으로 표시하기 위해 테이블 내부에 foreach 루프가 있습니다.
div 콘텐츠를 동적으로 변경하는 방법은 무엇입니까?
<table cellpadding="3" cellspacing="0" align="center">
<?php
foreach($test as $testcontent){
echo '<tr>';
echo '<td class="trigger">'.$testcontent[0].'</td>';
echo '<td class="trigger">'.$testcontent[1].'</td>';
echo '<td class="trigger">'.$testcontent[2].'</td>';
echo '<div id = popup style="display:none">
<div class="Month">
<div class="MonthDiv">
<span class="MonthText">'.$testcontent[0].'</span>
</div>
</div>
</div>';
echo '</tr>';
}
?>
</table>
기능 .../미행으로 팝업가 숨기 보여
$(function() {
var moveLeft = 20;
var moveDown = 10;
$('.trigger').hover(function(e) {
$('#popup').show();
//.css('top', e.pageY + moveDown)
//.css('left', e.pageX + moveLeft)
//.appendTo('body');
}, function() {
$('#popup').hide();
});
$('.trigger').mousemove(function(e) {
$("#popup").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
});
});
는참조 : I used this link for popup
팝업이 표시되지만 내가 3가 .... 행이 첫 번째 행의 내용이 팝업에 표시됩니다, 2 위로 마우스를 이동할 때 문제입니다.
이유를 모르겠습니다. 어느 누구도이 일에서 나를 도울 수 있습니까?
정상적으로 작동하는 비트의 코드를 표시하는 이유는 무엇입니까? – sje397