2014-11-14 44 views
0

我有一个Facebook的模态弹出,我有一个Facebook的喜欢/分享按钮粘贴。如何在有人点击Facebook按钮后关闭引导模式?

该按钮工作正常。模式关闭按钮正常工作。我想知道是否有一种方法可以使我的模式关闭后,类似的和共享按钮已被点击使用PHP。思考?谢谢!

<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> 
+0

可以使用[Facebook的JavaScript的API](https://developers.facebook.com/docs/javascript)当用户点击等按钮来检测。 – Jerodev 2014-11-14 14:43:36

+0

如何做到这一点?是否有我需要编辑的特定内容? – 2014-11-14 16:24:33

回答

1

你可以在你的JavaScript调用$('modalname').modal('hide');,或调用的东西,反过来调用隐藏方法手动关闭模式。

http://getbootstrap.com/javascript/#modals-usage

+0

我已经完成了。我想我的问题应该是更具体的 - 当你点击Facebook的按钮时,它会弹出一个关闭按钮的下拉菜单。我想让模式按钮改变,以反映他们点击和喜欢。这有意义吗?这是可能的甚至? – 2014-11-14 14:45:42

+0

正如Jerodev在上面指出的那样,您可以使用Facebook API来确定用户是否/何时点击了两个按钮并从那里拨打电话。你的问题标题基本上是问,“在完成某件事后我怎样才能关闭一个模态?”这就是为什么我回答我的方式。 – MattD 2014-11-14 14:51:03

相关问题