정말이 문제에 도움이되기를 바랍니다. 첫 페이지에는 효과가있는 Ajax 페이지 매김 스크립트가 있지만 클릭 이벤트는 페이징의 다른 페이지에서 작동하지 않습니다.ajax 호출 후 클릭 이벤트가 작동하지 않습니다.
jQuery를 스크립트
<script type="text/javascript">
// prepare when the DOM is ready
$().ready(function() {
//popup div
$(".wsbutton_pop").click(function(e){
//getting height and width of the message box
var height = $('#popuup_div').height();
var width = $('#popuup_div').width();
//calculating offset for displaying popup message
leftVal=e.pageX-(width/2)+"px";
topVal=e.pageY-(height/2)+"px";
//show the popup message and hide with fading effect
$('#popuup_div').css({left:leftVal,top:topVal}).show();
$('#popuup_div').html("<img src='images/ajaximg.gif' border='0'>");
$.ajax({
type: "get",
url: $(this).attr("href"),
success: function(r){
$('#popuup_div').html("")
$('#popuup_div').prepend(r);
}
});
});
//close div on mouse click
$(".popup_msg").click(function(e){
$('#popuup_div').fadeOut();
});
});
</script>
다른 페이지 콘텐츠와 사업부 팝업해야합니다
이 내가 그것을 설정을 가지고 방법이다.
지금 내 링크 : 초기 페이지에서 잘 작동하지만 페이지 동일한 링크가이 방문을 클릭하면 이제 문제는<a href="http://mysite.com/file.php?content=1" class="wsbutton_pop">Load content</a>
링크가 더 이상 작동하지 않습니다.
참고로 내 페이지는 div = "페이징"으로로드해야합니다. 아약스 페이징 자체는 훌륭하게 작동합니다. 결과 페이지의 jquery 클릭 이벤트가 작동하지 않습니다. 문제는 스크립트를 리 바인드해야 할 수도 있지만이를 수행하는 방법을 모른다는 것입니다.
감사합니다.
감사합니다. . 이것은 잘 작동합니다. –
이 작업은 jQuery 2.x에서 가능합니까? – user2636556