Jquery 脚本不';不能在ajax内容中工作
我加载动态内容的脚本是这样的,并且工作得非常完美,问题是我无法将脚本包含到动态内容中: $('nav li a')。单击(函数(){ 有人能帮我吗Jquery 脚本不';不能在ajax内容中工作,jquery,Jquery,我加载动态内容的脚本是这样的,并且工作得非常完美,问题是我无法将脚本包含到动态内容中: $('nav li a')。单击(函数(){ 有人能帮我吗 提前谢谢。但是您在$('.lightbox').lightbox()之前有一个返回false;。这不是问题吗?确定不是问题所在吗 $(this).addClass("green"); $('nav a').not(this).removeClass("green"); var toLoad = $(this).attr(
提前谢谢。但是您在
$('.lightbox').lightbox()之前有一个返回false;
。这不是问题吗?确定不是问题所在吗
$(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();