简体   繁体   English

花式框回调函数.load jquery

[英]fancy box callback function .load jquery

$("#btnOK").click(function(){
    parent.$("#res"+(d)).load("Customise.php #uni", "PID="+$("#P option:selected").val());
    parent.$.fancybox.close(function(){
    $("#res"+(d-1)+" a#p").fancybox({
            'transitionIn'  : 'elastic',
            'transitionOut' : 'elastic',
            'width':400,
            'height':300,
            'overlayOpacity'    : 0.5,
            'type'              : 'iframe'
        });
    });
});

after i click the button. 在我单击按钮之后。 i use a callback function to reintialise a#p it can't work? 我使用回调函数重新初始化#p,这行不通吗? any solution? 有什么办法吗?

        <div class="cell">
    <label id="pID">PID</label> <br /> <input type="text" id="txtPID" size="3" value="<? if(is_numeric($pID)) print("$pID"); ?>"/>   
    <a href="SelectP.html" id="p"><img src="Images/P.png" name="SelectP_button" id="SelectP_button" /></a>
    </div>

are you sure you want to select $("#res"+(d-1)+"a#p") ? 您确定要选择$(“#res” +(d-1)+“ a#p”)吗?

Im assuming that d is a number and you will therefore generate: 我假设d是一个数字,因此您将生成:

#res3a#p

in your selector, which is invalid, youre probably trying to do this 在您的选择器中,这是无效的,您可能试图这样做

$("#res"+(d-1)+" a#p")
$("#btnOK").click(function(){
    parent.$("#res"+(d)).load("Customise.php #uni", "PID="+$("#P option:selected").val());
    parent.$.fancybox.close();
});


$("#res"+(d-1)+" a#p").fancybox({
        'transitionIn'  : 'elastic',
        'transitionOut' : 'elastic',
        'width':400,
        'height':300,
        'overlayOpacity'    : 0.5,
        'onClosed: function(){
         $("#res"+(d-1)+" a#p").fancybox({
                   'transitionIn'  : 'elastic',
                   'transitionOut' : 'elastic',
                   'width':400,
                   'height':300,
                    'overlayOpacity'    : 0.5,
                    'type'              : 'iframe'
                     });
         },
        'type'              : 'iframe'
    });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM