炉石狂野冰法:这个对象是用来干什么的 ?

来源:百度文库 编辑:高校问答 时间:2024/04/19 15:06:32
function change(obj,i) {he=parseInt(obj.style.height);
if (he>=80&&he<=400)
obj.style.height=he+i+'px';
else
obj.style.height='80px'}

页面中的一个对象(obj)和你要给他定的高度(i)给传进去,如果他的高度是80到400之间,他的高度就为(i)象素高
如果不在这个范围内,就显示为80象素高