document.viewport.getHeight()返回为0
使用prototype的document.viewport.getHeight()始终返回为0,不解。终于在一个国外的论坛上找到一个答案: Turns out you need a correct DOCTYPE to make it work properly, otherwise Prototype will be in "quirks mode" which doesn't let getheight() work as intended. Problem solved, then. Now time to wait 48 hours >_> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |