简体   繁体   English

化装盒未关闭

[英]Fancy Box not closing

I recently started experimenting with fancy box. 我最近开始尝试使用花哨的盒子。 I am triggering the fancy box when there is a preg match in the url. 网址中有预匹配项时,我会触发花式框。 Everything is running fine except upon clicking OK or CANCEL the fancy box is not closing. 一切运行正常,除非单击“确定”或“取消”,精美框没有关闭。

if(preg_match('/school/',$_SERVER['REQUEST_URI']) )
    {
       ?>
       <script>$("#single_image").fancybox().trigger('click');</script>
       <?php

    } 

<div style="display:none;" id="single_image" >
<p>Continue or Decline</p>
<p><input type="button" onclick="php_function();" value="OK" /><input type="button" value="CANCEL" onclick="$.fancybox.close();"</p></div>

php_function() is a javascript function for ajax call. php_function()是用于ajax调用的javascript函数。

why not open it whith its method instead trigger('click') ? 为什么不通过它的方法而不是trigger('click')打开它?

$.fancybox.open( [group], [options] )

ref: http://fancyapps.com/fancybox/#docs 参考: http : //fancyapps.com/fancybox/#docs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM