窗口。 disptacheventresize问题?
在窗口resize()
触发时,它必须采用“ #snapContainer
” div (我的意思是background-css
属性)
我的jquery代码是,
$('#snapContainer').css({"background-size": "95%", "min-height": "100%", "position": "relative", "left": "2%", "margin-bottom": "15%", "display": "inline-block"}); $('.'+snapCloseClass).show(); //window.dispatchEvent(new Event('resize')); $(window).resize(function() { $('#snapContainer').css({"background-size": "95%", "min-height": "100%", "position": "relative", "left": "2%", "margin-bottom": "15%", "display": "inline-block"}); });