I am in the process of developing a website and have implemented code to blur out the background:
CSS
#background{
background: url(img/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%;
min-height: calc(100% - 96px);
-o-transition: all 750ms;
-moz-transition: all 750ms;
-webkit-transition: all 750ms;
transition: all 750ms
}
.covered{
background: url(img/bgb.jpg) no-repeat center center fixed!important;
-webkit-background-size: cover!important;
-moz-background-size: cover!important;
-o-background-size: cover!important;
background-size: cover!important;
}
jQuery
$('.overlay,.ov').click(function(){
$('#background').addClass('covered');
}
HTML
<div id="background">
//content of my page
</div>
I have experimented with different solutions:
-I attempted using the blur filter
, but it resulted in the content being blurred as well.
-I also tried utilizing a sprite, however, due to the requirement of centering the background images, only the top section appeared normal while the bottom section was blurred.
Although my current code functions effectively, there is a delay in loading the new blurry background image when the overlay is clicked, causing a momentary white background. Any recommendations or suggestions to improve this issue?