을 통해 만든 경우 발생하지 : 왜 HTML의 기존 된 DIV도 따라서 경고 마우스를 트리거 할마우스 트리거가 제대로 HTML이 코드에 대한 JQuery와
<div id="header">top of page</div>
<div class="message">hello, how are you</div>
<div class="message">I am fine</div>
$(document).ready(function()
{
$("#header").append('<div class="message">appended DIV</div>');
$('div.message').hover(
function() {
alert('hi');
},
function() {
alert('bye');
}
);
});
하지만, appeneded DIV는 죽지 않을 것이다. 추가 된 DIV는 기존의 DIV와 어떻게 반응합니까?
감사합니다.
편집 : 스팬이 호버 기능 아래에 배치하는 경우, 그것은 작동하지 않습니다,
$('<span />').addClass('message').text('(mouse 1)').appendTo('#header');
$('<span />').addClass('message').text('(mouse 2)').appendTo('#header');
$('.message').hover(
function() {
$('#header').prepend('in');
},
function() {
$('#header').prepend('out');
}
);
참고 : 요약에이 솔루션을했다.
나를 위해 잘 작동합니다 ... 어떤 브라우저를 사용하고 있습니까? –
나를 위해 잘 작동합니다. – Canton
저는 Chome과 FF3을 사용하고 있습니다 - 테스트 페이지에서 http://jobs.happyzion.com/test.html – Adrian33