jquery 的facebox 问题
jQuery的facebox插件,可以弹出网页,但是,如果点击弹出页面中的某个按钮,怎么让弹出的网页关闭呢? jquery
[解决办法]
绑定reveal.facebox事件,然后用给内容中的按钮绑定click事件触发facebox关闭事件即可
<script>
$(document).bind('reveal.facebox', function () {
//////////////注意修改选择器。
$('#CloseFaceBox').click(function () { $(document).trigger('close.facebox'); });
});
$(function () {
$('a[rel]').facebox();
});
</script>
<a href="content.html" rel="facebox">content</a>