I am guessing you mean something like this. JSFIDDLE.
jQuery
$(".fancybox").fancybox({
beforeShow: function () {
$("body *:not(.fancybox-overlay, .fancybox-overlay *)").addClass("blur");
},
afterClose: function () {
$("body *:not(.fancybox-overlay, .fancybox-overlay *)").removeClass("blur");
}
});
CSS
.blur {
-webkit-filter: blur(5px)
}
As Martin Kovachev points out in the comments, this may be very resource-intensive on the CPU, and cause some delay and/or strange performance issues. Therefore, it can be useful to add hardware acceleration. Most often a 3D emulation technique is used where a 3D layer is added but not actually used, e.g. by setting translateZ(0)
or translate3D(0,0,0)
.