简体   繁体   English

有人单击类似Facebook的按钮后,如何关闭引导程序模式?

[英]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.

相关问题 用户单击Facebook赞按钮后,如何显示带有消息的弹出窗口? - How can I display a popup window with a message after a user clicks the Facebook like button? 打开后如何关闭引导程序模式? - How can I close bootstrap modal after open? 如何使用最后弹出的模式上的关闭按钮关闭多个引导程序模式 - How can I close multiple bootstrap modals with the close button on the last popped modal 每当有人单击按钮时,如何为变量分配1? - How can I 1 to a variable for every time someone clicks a button? 当有人单击Facebook赞按钮时如何触发事件? (在Google跟踪代码管理器中) - How to trigger an event when someone clicks the Facebook Like Button? (in Google Tag Manager) 如何关闭和打开像Bootstrap这样的模态 - How to close & open a modal like Bootstrap Bootstrap模式打开按钮在关闭后需要单击两次才能重新打开 - Bootstrap modal open button requires two clicks to reopen after closing 如何计算我网站上的Facebook Connect按钮点击 - How can I count Facebook Connect button clicks on my site 如何关闭Bootstrap中的模式框? - How can I get my modal box in Bootstrap to close? 用户单击文件上传中的关闭按钮后,如何关闭窗口? - How do I close a window after the user clicks on the close button in file upload?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM