ajax呼び出し後にライトボックスに問題が発生しました
現時点ではこんな感じです
$(".trackz").click(function () {
$(".contentmusic").remove();
$.ajax({
url: "data/loadContent.php?clickedcontent=" + $(this).attr("id"),
success: function (html) {
if (html) {
$("#lightbox-panel").append(html);
$("#lightbox, #lightbox-panel").fadeIn(300);
}
}
});
});
しかし、このajax呼び出しでnewcontentをロードすると
$(window).scroll(function () {
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
var myStylesLocation = "css/demo.css";
$.ajax({
url: "data/loadMoreMusic.php?lastMusic=" + $(".trackz:last").attr("id"),
success: function (html) {
if (html) {
$("#trackz").append(html);
$('.fdw-background').hover(
function () {
$(this).animate({
opacity: '1'
});
},
function () {
$(this).animate({
opacity: '0'
});
}
);
} else {
$('div#loadMoreMusic').replaceWith("<center>Finished loading Music</center>");
}
}
});
}
});
2回目のajax呼び出しによって生成された新しいコンテンツでは、ライトボックスが機能しなくなりました。誰かアイデア?