0

我在我的facebox模式上使用了我的自定义关闭按钮来关闭它......它工作正常(即)它关闭但它在我点击关闭按钮后附加到页面底部......

<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>
4

2 回答 2

6

我将 OnClick 替换为此onclick="javascript:$(document).trigger('close.facebox')"并且它有效..

于 2010-07-28T04:35:14.107 回答
0

可以像修复选择器一样简单吗?:

<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> 
于 2010-07-27T17:25:28.893 回答