Yan*_*n78 0 php wordpress modal-dialog twitter-bootstrap
我有这行 PHP:
$STRING .= $b_f.'<a href="'.get_home_url().'/wp-login.php" class="ua5 '.$linkclass.'">'.$CORE->_e(array('head','5','flag_link')).'</a>'.$b_a;
Run Code Online (Sandbox Code Playgroud)
这个网址现在作为一个新网页打开。如何将其作为对话框/模式窗口打开?在我的代码中,我安装了引导程序。
试试这个“技巧”:
<a href="http://twitter.github.io/bootstrap/" class="btn bootpopup" title="This is title" target="popupModal2">Open modal</a>
<div id="popupModal2" class="modal hide fade" tabindex="-1" role="dialog">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Title</h3>
</div>
<div class="modal-body">
<iframe src="" style="zoom:0.60" frameborder="0" height="250" width="99.6%"></iframe>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">OK</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
和js:
$('.bootpopup').click(function(){
var frametarget = $(this).attr('href');
var targetmodal = $(this).attr('target');
if (targetmodal == undefined) {
targetmodal = '#popupModal';
} else {
targetmodal = '#'+targetmodal;
}
if ($(this).attr('title') != undefined) {
$(targetmodal+ ' .modal-header h3').html($(this).attr('title'));
$(targetmodal+' .modal-header').show();
} else {
$(targetmodal+' .modal-header h3').html('');
$(targetmodal+' .modal-header').hide();
}
$(targetmodal).on('show', function () {
$('iframe').attr("src", frametarget );
});
$(targetmodal).modal({show:true});
return false;
});
Run Code Online (Sandbox Code Playgroud)
只需将您的链接传递给按钮的href.
| 归档时间: |
|
| 查看次数: |
17099 次 |
| 最近记录: |