ユーザーがリンクをクリックするとjQueryUIダイアログが表示されるワードプレスプラグインを開発しました。
そのダイアログには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>
インストールされたプラグインが含まれています。