手动隐藏jQuery Facebox模式 [英] hide jquery facebox modal manually

查看:86
本文介绍了手动隐藏jQuery Facebox模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了我的Facebox模式上的自定义关闭按钮将其关闭...它工作正常(即,它已关闭,但是在我单击关闭按钮后会附加到页面底部...

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>

这就是我得到的,

这就是我要做的事,

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

推荐答案

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

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

这篇关于手动隐藏jQuery Facebox模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆