手动隐藏jquery Facebox模式

发布于 2024-09-11 07:01:47 字数 1297 浏览 3 评论 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>

I used my custom close button on my facebox modal to close it... It works fine (ie) it closes but it appends to the bottom of the page after i click the close button...

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

Here is what i get,

alt text

Here is what i am trying to do,

$(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()
        })

    })

My page has this,

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

晚风撩人 2024-09-18 07:01:47

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

I replaced OnClick to this onclick="javascript:$(document).trigger('close.facebox')" and it worked..

乖乖哒 2024-09-18 07:01:47

就像修复你的选择器一样简单吗?:

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

could it be as easy as fixing your selector?:

<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> 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文