隐藏的jquery facebox手动模态(hide jquery facebox modal ma

2019-11-04 03:09发布

我用我的自定义关闭按钮在我facebox模式来关闭它......它工作正常(IE)将关闭,但之后我点击关闭按钮追加到页面底部...

<a onclick="$.facebox.close();" href="javascript:void(0);" class="close"> 
  <img alt="Close the popup" src="images/close.png" title="close" 
     class="close_image" /> 
</a>

以下是我得到的,

这里就是我试图做的,

$(document).bind('close.facebox', function() {
        $(document).unbind('keydown.facebox')
        $('#aspnetForm').append($('#facebox .content').html());
        /// extra line to make sure there's no flashing effect as the facebox closes: the content is still in there too!
        $('#facebox .content').children().css({ 'display': 'block' });
        $('#facebox').fadeOut(function() {
            $('#facebox .content').removeClass().addClass('content')
            hideOverlay()
            $('#facebox .loading').remove()
        })

    })

我的页面有这个,

   $(document).ready(function($) {
        $.facebox.settings.opacity = 0.2;
        $('a[rel*=facebox]').facebox();
     });

  <div id="forgetPassword" style="display:none"> 
    //content
   </div>

Answer 1:

我取代的OnClick这个onclick="javascript:$(document).trigger('close.facebox')"和它的工作..



Answer 2:

难道是因为修复您的选择一样容易?:

<a onclick="$('#facebox').close();" href="javascript:void(0);" class="close">  
  <img alt="Close the popup" src="images/close.png" title="close"  
     class="close_image" />  
</a> 


文章来源: hide jquery facebox modal manually