无法在hide / show div中加载外部页面

时间:2012-07-18 14:01:48

标签: jquery

我的问题是:

我有一些外部网页fotos1.asp,当我点击聚会的主要照片时,我在我的#fotos_dentro内拨打index.asp

此主照片位于另一个div #fotos内。我使用一些jquery脚本来处理这个问题。

我有一些scrollBar脚本..所以发生了什么?

我的fotos1.asp不在#fotos_dentro内部。

这是我的剧本:

$(function(){

   $("#fotos_dentro").hide();

    $('.fotos1').live('click', function(e) {
        e.preventDefault();
        var h = $(this).attr('href');
        $.get(h, function() {
            $("#fotos").fadeOut("slow", function() {
                $("#fotos_dentro").show(function(){
                    $(this).load(h).fadeIn("slow", function(){
                        $("#mcs_container").mCustomScrollbar("vertical",400,"easeOutCirc",1.05,"30","yes","yes",10);
                    });
                });
            });
        });
    });
});

这是我的HTML:

<div class="conteudo">
    <!-- comeco sroll -->
    <div id="mcs_container" class="rolagem">
        <div class="customScrollBox">
            <div class="container">
                <div class="content">
                <div id="fotos_dentro"></div>
                <div id="fotos">
                    <!-- HERE IS MY ASP PROGRAMMING -->
                </div>
                </div>
            </div>
            <div class="dragger_container">
                <div class="dragger"></div>
            </div>
        </div>
    </div>
    <!-- fim scroll -->
</div>

以下是我的网站:http://www.alsite.com.br/luxxx/ - 点击GALERIA即可查看问题。

1 个答案:

答案 0 :(得分:1)

在这种情况下,

.load是多余的,只需附加返回的html。

$(function() {

    $("#fotos_dentro").hide();

    $('.fotos1').live('click', function(e) {
        e.preventDefault();
        var h = $(this).attr('href');
        $.get(h, function(data) {
            $("#fotos").fadeOut("slow", function() {
                $("#fotos_dentro").html(data).fadeIn("slow", function() {
                    $("#mcs_container").mCustomScrollbar("vertical", 400, "easeOutCirc", 1.05, "30", "yes", "yes", 10);
                });
            });
        });
    });
});​
相关问题