뭔가 :
var timer = setInterval(function() {
if (element.className=='someclass') {
//run some other function
goDoMyStuff();
clearInterval(timer);
}
}, 200);
또는 요소들을 삽입 할 수 있습니다 :
function flagInsertedElement(event) {
var el=event.target;
}
document.addEventListener('DOMNodeInserted', flagInsertedElement, false);
jQuery를 버전 :
$(document).on('DOMNodeInserted', function(e) {
if (e.target.className=='someclass') {
goDoMyStuff();
}
});
또한 liveQuery 플러그인있다 :
$("#future_element").livequery(function(){
//element created
});
또는이 이벤트가 일반 이벤트 핸들러 인 경우 jQuery의 on();
다른 스크립트를 제어 하시겠습니까? 코드를 다른 코드의 콜백으로 호출 할 수 없습니까? – j08691
또는 다른 스크립트를 가져와 사용자 지정 이벤트를 발생 시키십시오. – rgvcorley
이 질문과 중복되는 것 같습니다 : http://stackoverflow.com/questions/1950038/jquery-fire-event-if-css-class-changed –