白开水

海阔凭鱼跃,天高任鸟飞!

  博客园 :: 首页 :: 联系 :: 订阅 订阅 :: 管理
  20 Posts :: 2 Stories :: 4 Comments :: 0 Trackbacks

公告

2012年4月11日 #

<style type="text/css">
.ifile {position:absolute;opacity:0;filter:alpha(opacity=0);}
</style>
<form  method="post">
 <input type="file" name="file" id="file" size="20" class="ifile" onchange="upfile.value=this.value"/>
 <input type="text" name="upfile" size="20" readonly/>
 <input type="button" value="选择上传文件"/>
 <input type="Submit" name="Submit" value="上传"/>
</form>

posted @ 2012-04-11 11:23 baikaishui1989 阅读(126) 评论(0) 编辑

2012年3月29日 #

<script type="text/javascript">
//工厂模式
function person(name,age,add){
var o=new Object();
o.name=name;
o.age=age;
o.add=add;
o.smay=function(){
alert(o.name);
}
return o;
}
var person1=person('xioawang',25,'北京');
person1.smay();
</script>
<script type="text/javascript">
//构造函数
function Person(name1,age1,add1){
this.name1=name1;
this.age1=age1;
this.add1=add1;
this.smay1=function(){
alert(this.name1);
}
}
var person2=new Person('xiaoli',25,'handan');
person2.smay1();
</script>
<script type="text/javascript">
//原型模式
function person11(name2,age2,add2){
person11.prototype.name2='xiaozhang';
person11.prototype.age2=15;
person11.prototype.add2='hebei';
person11.prototype.saym2=function(){
alert(person11.prototype.name2);
}
}
var person22=new person11();
person22.saym2();
var person33=new person11();
person33.saym2();
alert(person11.prototype.isPrototypeOf(person22));
</script>
<script type="text/javascript">
//更简单的原型方法
function person111(){
}
person111.prototype={
name222:'xiaowang',
age222:25,
add222:'beijing',
smay222:function(){
alert(this.name222);
}
}
var person333=new person111;
person333.smay222();
</script>

posted @ 2012-03-29 16:10 baikaishui1989 阅读(130) 评论(2) 编辑

posted @ 2012-03-29 14:42 baikaishui1989 阅读(133) 评论(0) 编辑

2012年3月13日 #

<script language="JavaScript">
function myrefresh()
{
window.location.reload();
}
setTimeout('myrefresh()',5000); //指定1秒刷新一次
</script>

posted @ 2012-03-13 11:46 baikaishui1989 阅读(153) 评论(0) 编辑

2012年3月5日 #

<script type="text/javascript">
function f1(){
    var x=100;
    function f2(){
        alert(++x);
        }
    return f2    
    }
var f3=f1();
f3();

</script>

posted @ 2012-03-05 16:35 baikaishui1989 阅读(160) 评论(0) 编辑

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">

</script>
<script type="text/javascript">
var x=400;
function dianji(){
    document.getElementById('yincang').style.height=x+'px';
    x--;
    var time=setTimeout('dianji()',10);
    if(x==200){    
    clearTimeout(time);    
    //document.body.bgColor='red';
    document.getElementById('yincang').style.display='none';
    document.getElementById('xianshi').style.display='block';
    
    }
    }
</script>
<script type="text/javascript">

</script>
<style type="text/css">{ display:block}</style>
</head>

<body onload="dianji()" >

<div id="yincang" style=" background:#CCC; height:400px;"></div>
<div id="xianshi" style="background:#0F0; height:200px; display:none;">fdafda</div>
<div style="background:#666; height:2000px;"></div>

</body>
</html>

posted @ 2012-03-05 11:12 baikaishui1989 阅读(99) 评论(0) 编辑

2012年2月27日 #

posted @ 2012-02-27 15:19 baikaishui1989 阅读(98) 评论(0) 编辑

2012年2月17日 #

摘要: <!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"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-阅读全文
posted @ 2012-02-17 15:43 baikaishui1989 阅读(144) 评论(2) 编辑

2012年2月16日 #

摘要: <ul><li onmousemove="xianshi('wang')" onmouseout="yincang('wang')"><a href="#">鼠标扑捉</a><ul><li id="wang" style=" width:200px; height:200px; background:#CCC;"> <a href="#">显示与隐藏</a阅读全文
posted @ 2012-02-16 10:43 baikaishui1989 阅读(151) 评论(0) 编辑

2012年2月8日 #

摘要: <!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"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-阅读全文
posted @ 2012-02-08 16:41 baikaishui1989 阅读(150) 评论(0) 编辑