[英]How can I close a bootstrap modal after someone clicks a facebook like button?
I've got a facebook modal pop-up that I have a facebook like/share button pasted in. 我有一个Facebook模态弹出窗口,上面粘贴了一个Facebook的“赞/共享”按钮。
The button works fine. 该按钮工作正常。 The modal close button works fine.
模式关闭按钮可以正常工作。 I'm wondering if there's a way for me to have the modal close AFTER both the like and share button have been clicked using PHP.
我想知道是否有一种方法可以在使用PHP单击“ like”和“ share”按钮之后使模式关闭。 Thoughts?
思考? Thanks!
谢谢!
<div class="modal fade" id="modal-example" tabindex="-1" role="dialog" aria-labelledby="modal-example" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
<h1 class="modal-title" id="myModalLabel">LIKE AND SHARE TO WIN</h1>
</div>
<div class="modal-body">
<h4>Like us on facebook, share our page, and automatically get entered to win!</h4>
<div class="fb-like" data-href="https://www.facebook.com/page" data-layout="button" data-action="like" data-show-faces="true" data-share="true"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
You can manually close a modal by calling $('modalname').modal('hide');
您可以通过调用
$('modalname').modal('hide');
手动关闭模式$('modalname').modal('hide');
in your JavaScript, or calling to something that in turn calls to the hide method. 在您的JavaScript中,或调用某些东西,依次调用hide方法。
http://getbootstrap.com/javascript/#modals-usage http://getbootstrap.com/javascript/#modals-usage
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.