我开发了一个 word press 插件,当用户单击链接时会显示 jQuery UI 对话框。
该对话框包含一个 facebook 按钮。该按钮通常出现在对话框之外,但不会显示在对话框中。
当我加载页面并在页面加载完成之前赶紧点击链接时,按钮显示并正常工作!
我使用了 FB 调试器,没有任何警告。
jquery函数:
    <script type="text/javascript">
    var timer;
    var isclose=<?php echo get_option('WPVS_close')?>;
    jQuery(document).ready(function() {
    //jQuery(function(){        
    //popup box jquery settings
    jQuery(".cdialog").dialog("modal");
    jQuery(".cdialog").dialog({                     
                    autoOpen: false,
                    modal:true,
                    title: "",
                    zIndex: 9998,
                    closeOnEscape: true,
                    resizable: false,
                    width: <?php echo get_option('WPVS_width');?>,
                    height: <?php echo get_option('WPVS_height');?>,
                    beforeClose: function(event, ui) { clearTimeout(timer);    clearInterval(timer); },
                    open: function(event, ui) {
                        delay=<?php echo get_option('WPVS_delay');?> ;
                        isclose=<?php echo get_option('WPVS_close'); ?>;
                        timer=setInterval( "delaytime()" , 1000);
                        jQuery(".ui-dialog-titlebar", ui.dialog).hide();
                        jQuery(".ui-dialog-titlebar-close", ui.dialog).show();
                        if (!isclose||urll==location.href){jQuery("#closebutton").hide();};
                    }
                    });
  jQuery(function() {
       jQuery( "#closebutton" ).button({
        icons: {
            primary: "ui-icon-close"
        },
        text: false
    });
    jQuery( "#closebutton" ).click(function(event)
    {
        jQuery(".cdialog").dialog("close");
    });
});
    });
       </script>
包含对话框的 div:
<div  class="cdialog"  title="" >
<p>Please Share Our Page On Social Networks Or Wait  <b class="ctimer" ></b> seconds<b class="ctimernn" ></b> To Be Redirected</p>
<div><fb:like href="'.get_option('ste_like').'" send="false" width="450" show_faces="true"></fb:like></div>
<div><a href="https://twitter.com/share" class="twitter-share-button" data-lang="en" data-text="'.get_option('ste_tweet').'" data-url="'.get_option('ste_tweet_url').'">Tweet</a></div>
<g:plusone callback="plusdone" href="'.get_option('WPVS_gplus').'"></g:plusone>         
</div>
包含已安装的插件。