今天我有一個快速的問題。這裏是我的功能:從div高度減去jQuery
function checkheight() {
var heightofdiv = $('#checkforheight').height();
$("#centeredbackground").css("min-height",heightofdiv);
}
我的問題是,我想我的變量,heightofdiv,再由42個像素減去答案。所以真的,我希望heightofdiv等於checkforheight減去42像素的高度。如果這甚至是可能的,將不勝感激。謝謝!
我不太明白......你能解釋一下嗎? – elclanrs 2012-02-29 22:40:02
你應該使用jquery算術插件:var heightofdiv = $ .subtract($('#checkforheight')。height(),42);'[found here](http://www.doxdesk.com/img/)更新/ 20091116-so-large.gif) – 2012-02-29 23:17:07