jQuery获取width为0,获取隐藏元素实际宽度

$("#pageLoadingInnerDiv").css("display", "block");
			var iconMarginLeft = (926-jQuery("#pageLoadingTipMsg").width())/2;
			jQuery("#pageLoadingInnerDiv > div:first").css("margin-left", iconMarginLeft+"px");
			console.log(jQuery("#pageLoadingTipMsg").width());
			
			//还原到初始状态
			jQuery("#pageLoadingInnerDiv").hide();

 

你可能感兴趣的:(jQuery)