0
動的コンテンツを読み込むためのスクリプトはこれで完全に動作しますが、動的コンテンツにスクリプトを含めることができないという問題があります。 :。スクリプトはajaxコンテンツでは動作しません
$( 'NAVの李A')をクリックします(関数(){この方法では動作しません
$(this).addClass("green");
$('nav a').not(this).removeClass("green");
var toLoad = $(this).attr('href')+' #content';
$('#content').hide('fast',loadContent);
$('#load').remove();
$('#main').append('<span id="load">LOADING...</span>');
$('#load').fadeIn('normal');
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
function loadContent() {
$('#content').load(toLoad,'',showNewContent());
}
function showNewContent() {
$('#content').show('slow',hideLoader());
}
function hideLoader() {
$('#load').fadeOut('normal');
}
return false;
// this is the script that i want to trigger
$('.lightbox').lightBox();
});
、私はまた、このようにデリゲートモードを試してみてください。
$('#content').delegate('img', 'click', light);
var light = $('.lightbox').lightBox();
誰も私を助けてください?事前に
感謝。
doesnt 'work :( – niceoutput