我用我的自定義關閉按鈕在我的facebox模式關閉它...它工作正常(即)它關閉,但它附加到頁面的底部後,我點擊關閉按鈕...隱藏jquery 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>
這裏是我得到的,
alt text http://img825.imageshack.us/img825/3739/foo.jpg
這就是我要做的,
$(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>
爲什麼人們仍然使用'javascript:void(0)'? – 2010-07-27 17:24:51