« ad | 首页 | zhangrui »
个人主页: http://277684276.qzone.qq.com
在 用Javascript获取页面元素的位置 留言:
function getPagearea(){ if (document.compatMode == "BackCompat"){ return { width: document.body.scrollWidth, height: document.body.scrollHeight } } else { return { width: document.documentElement.scrollWidth, height: document.documentElement.scrollHeight } } } -------------------------------- 这代码写得有点啰嗦,可以改成这样。 function my_function() { if ( xxxx ) { return xxxx; } return xxxx; } 或者这样: function my_function() { var ret_value = null; if ( xxxx ) { ret_value = xxxx; } return ret_value; }
2009-09-15 09:32:17
在 HTML模板和CSS基准样式(二) 留言:
text-center { text-align:center; } 这个只支持IE吧,firefox没有得到支持。
2009-02-09 09:59:37
在 Paul Graham:为什么在经济危机中创业? 留言:
好文,看了很受启发。 这样跟自己说吧,辞职创业去,失败了,大不了重回打工的行列。
2008-12-12 08:35:01
在 如何著录书名? 留言:
阮兄,写个小程序去抓dangdang.com上的书籍信息就OK了,这样不用录。
2008-11-30 12:45:20
留言(4 条)
在 用Javascript获取页面元素的位置 留言:
function getPagearea(){
if (document.compatMode == "BackCompat"){
return {
width: document.body.scrollWidth,
height: document.body.scrollHeight
}
} else {
return {
width: document.documentElement.scrollWidth,
height: document.documentElement.scrollHeight
}
}
}
--------------------------------
这代码写得有点啰嗦,可以改成这样。
function my_function() {
if ( xxxx ) {
return xxxx;
}
return xxxx;
}
或者这样:
function my_function() {
var ret_value = null;
if ( xxxx ) {
ret_value = xxxx;
}
return ret_value;
}
2009-09-15 09:32:17
在 HTML模板和CSS基准样式(二) 留言:
text-center { text-align:center; }
这个只支持IE吧,firefox没有得到支持。
2009-02-09 09:59:37
在 Paul Graham:为什么在经济危机中创业? 留言:
好文,看了很受启发。
这样跟自己说吧,辞职创业去,失败了,大不了重回打工的行列。
2008-12-12 08:35:01
在 如何著录书名? 留言:
阮兄,写个小程序去抓dangdang.com上的书籍信息就OK了,这样不用录。
2008-11-30 12:45:20