0

这是 jQuery fancybox 库的代码。由于某种原因,关闭按钮未显示。请帮我。我想使用我自己的关闭按钮。在浏览器中,当我检查背景图像被删除但在正确的文件夹中。图像上有一条线。

$(window).load(function(){ 

// Gallery
if(jQuery("#gallery").length){


    // Fancybox
    jQuery("#gallery li a").fancybox({
        "titleShow" : false,
        "transitionIn"  : "elastic",
        "transitionOut" : "elastic",
                    "showCloseButton" : true
    });


    var totalImages = jQuery("#gallery > li").length, 
        imageWidth = jQuery("#gallery > li:first").outerWidth(true),
        totalWidth = imageWidth * totalImages,
        visibleImages = Math.round(jQuery("#gallery-container").width() / imageWidth),
        visibleWidth = visibleImages * imageWidth,
        stopPosition = (visibleWidth - totalWidth);

    jQuery("#gallery").width(totalWidth);


    jQuery("#gallery-prev").click(function(){
        if(jQuery("#gallery").position().left < 0 && !jQuery("#gallery").is(":animated")){
            jQuery("#gallery").animate({left : "+=" + imageWidth + "px"});
        }
        return false;
    });

    jQuery("#gallery-next").click(function(){
        if(jQuery("#gallery").position().left > stopPosition && !jQuery("#gallery").is(":animated")){
            jQuery("#gallery").animate({left : "-=" + imageWidth + "px"});
        }
        return false;
    });



}

});
4

0 回答 0