【发布时间】:2013-09-08 02:04:05
【问题描述】:
在初始化页面或调整页面大小时,高度计算似乎有所不同。
有人知道为什么吗?或者如何解决?
示例代码
$(document).ready(function () {
showcase_height_init();
$(window).resize(function() {
showcase_height_init();
});
});
function showcase_height_init() {
var showcase_container_text_height = ($("#showcase_container_text").height())/2;
$("#showcase_container_text").css({
margin: '-'+showcase_container_text_height+'px 0 0'
});
}
【问题讨论】:
标签: jquery resize documentation height