var $successTipsContainerLeft=($(window).width()-506)/2+"px"; //获取窗口可视区后定位 var $successTipsContainerTop=($(window).height()-245)/2+"px"; $(".successTipsContainer").css("left","$successTipsContainerLeft"); alert($successTipsContainerTop); //可以弹出计算后的值,如300px $(".successTipsContainer").css("top","$successTipsContainerTop"); //$successTipsContainerTop换成300px之类有效果,可是这个没效果
悟二空
Zmm0413