When the window starts, resize()it should take the " #snapContainer" div (I mean the background-cssproperties)
My jquery code is,
$('#snapContainer').css({"background-size": "95%",
"min-height": "100%",
"position": "relative",
"left": "2%",
"margin-bottom": "15%",
"display": "inline-block"});
$('.'+snapCloseClass).show();
$(window).resize(function() {
$('#snapContainer').css({"background-size": "95%",
"min-height": "100%",
"position": "relative",
"left": "2%",
"margin-bottom": "15%",
"display": "inline-block"});
});
source
share