그래서 jQuery의 내용을 바꿀 플로팅 된 div가 있습니다. 예를 들어 Bing과 Google 로고를 넣었지만 문서를 확인했지만 무엇이 잘못되었는지를 파악하지 못했습니다. 다른 사람들이 이전 콘텐츠를 태그로 대체하려고 할 때까지 문제가 발생했음을 알았지 만 작동하지 않았습니다. 중첩 된 div 때문에 문제가 발생 했나요 아니면 ...?jquery replaceWith는 클릭 호출에 응답하지 않습니다.
<style>
#content {
float: right;
width: 650px;
overflow-x: hidden;
color:fff;
}
#contentWrapper {
position: relative;
}
#explainWrapper1 {
float:left;
width:350px;
}
</style>
<script>
$('#amd1').click(function() {
$('#content').replaceWith('<img src="http://www.google.com/images/srpr/logo3w.png">');
});
</script>
...
<a href="#" id="amd1">Amendment 1</a>
<div id="contentWrapper">
<div id="content">
<img src="http://www.smartinsights.com/wp-content/uploads/2012/07/bing-logo.png">
</div>
<div id="explainWrapper1">
</div></div>
콘텐츠가 있기 전에 이벤트를 바인딩하려고합니다. 나중에 이벤트를 바인드하거나 스크립트를 호출하려면 delete를 사용하십시오. – Eru