我試圖做一個計算,但我不斷得到錯誤NaN; 你能幫我解決var testBottom的數學問題嗎?jQuery計算給NaN
jQuery(document).ready(function(){
var test = jQuery("#test");
var testTopOffset = test.offset();
var testTop = testTopOffset;
var testHeight = test.height();
var testBottom = parseInt(testTop + testHeight);
alert(testHeight);
alert(testBottom);
});
嘗試parseInt函數(testTop)+ parseInt函數(testHeight); – Satya 2013-02-28 15:24:32
歡迎來到StackOverflow :) – jbabey 2013-02-28 15:29:13
什麼價值越來越testTop&testHeight? – 2013-02-28 15:29:39