手动隐藏jquery Facebox模式
我在我的 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,
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将 OnClick 替换为
onclick="javascript:$(document).trigger('close.facebox')"
并且它有效。I replaced OnClick to this
onclick="javascript:$(document).trigger('close.facebox')"
and it worked..就像修复你的选择器一样简单吗?:
could it be as easy as fixing your selector?: