我跑了这个:
$(".navMore li a").on("click", function(e) {
e.preventDefault();
var clicked = $(this);
$('.loadContent').css('visibility', "visible");
$('.loading').css('visibility', "visible");
$(".nav li").removeClass("active");
$(this).parent().addClass("active");
url = this.href + " .content";
$newItems = $('<div></div>').css('visibility', 'hidden').fadeTo('fast', 0);
$newItems.load(url, function(){
$('#main').prepend( $newItems).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order', onLayout: fadeIt }); <== fadeIt is the function I am calling
$(".fotorama").fotorama();
Shadowbox.setup();
clicked.removeAttr("href");
$('.loadContent').css('visibility', "hidden");
$(".fotorama-fullscreen").bind('click', function(){
$this = $(this);
$("#wrapper").fadeTo(1000, 0,function(){
$("#main").isotope("destroy");
$this.parent().find(".fotorama").trigger('fullscreenopen');
$("#wrapper").fadeTo(1000, 1);
});
});
});
});
然后这个:
function fadeIt() {
alert("ciao");
$("#main div").css("visibility", "visible").fadeTo(1000, 1);
}
Chrome很好,代码可以工作,我得到警报,而firefox完全忽略它。我做错了什么?