开发者

Close color box using Another button - cant able to close why?

Hi similar question like this

I tried every solutions in the above condition.But not working f开发者_如何学Goor me.I have included colorbox and Jquery in overlaypage and the parent page.If I am not included on the overlay page then I cant able to call the close function It display the error colorbox not defined.In my color box the following code is displayed.

<script type='text/javascript' src='../js/Jquery.js'></script>
 <script type='text/javascript' src='../js/jquery.colorbox.js'></script>
<table width='100%' border='1' cellspacing='1' cellpadding='1'>
<tr>

    <td ><div id='cboxcancelbtn'  style='cursor:pointer;'> Cancel</div>
</tr>
 </table>
 <script type='text/javascript'>

$(document).ready(function()
{
      $('#closepopupbox').click(function()
    {
                $('#cboxClose').click();
        //$.colorbox.close();
    });
      });
   </script>

I tried lot but not working .I tried this one also but no luck

  <td ><div id='cboxcancelbtn' onclick='parent.closeColorbox(); return false;'> Cancel</div></td>
  <script>
    function closeColorbox() {
                $.fn.colorbox.close(); 

                     } 
   </script>

What I did the mistake.How can I make it work.Thanks in advance.


Just try this:

parent.$.fn.colorbox.close();

(instead of)

$.fn.colorbox.close();


First remove parent from parent.closeClorbox() on your onclick event or remove the onclick event and try this:

$('#cboxcancelbtn').click(function(){
  $.fn.colorbox.close();
})
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜