diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/css/main.css b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/css/main.css new file mode 100644 index 0000000..d53b645 --- /dev/null +++ b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/css/main.css @@ -0,0 +1,298 @@ + * + { + padding: 0px; + margin: 0px; + } + div.header + { + width: 100%; + height: 41px; + border-style: solid; + border-color: #FFFFFF; + border-width: 0px; + background-color: #E44049; + } + .picborder + { + border-width: 0px; + } + .header_pic + { + margin-left: 12%; + float: left; + width: 200px; + } + .header_t + { + float: right; + margin-right: 10%; + font-size: 12px; + width: 200px; + height:41px; + line-height: 40px; + position: relative; + } + .headert_a + { + color: #FFFFFF; + } + div.midd + { + border-style: solid; + border-color: #FFFFFF; + border-width: 0px; + width: 870px; + height: 596px; + margin-left: auto; + margin-right: auto; + } + div.footer + { + border-top-style: solid; + border-top-color: rgb(187,187,187); + border-top-width: 1px; + width: 1004px; + height: 120px; + margin-left: auto; + margin-right: auto; + } + div.left + { + border-style: solid; + border-color: #FFFFFF; + border-width: 0px; + width: 508px; + height: 530px; + margin: 59px 0px 0px; + float: left; + } + div.right + { + border-style: solid; + border-color: #EEEEEE; + border-width: 1px; + width: 351px; + height: 385px; + margin: 65px 0px 0px; + float: left; + background-color: #FDFDFD; + } + div.title + { + margin: 20px 0px 20px 0px; + } + h2 + { + font-family: ��Բ; + color: black; + font-size: 20px; + } + ul + { + list-style: none; + list-style-position: outside; + } + .ultit + { + font-size: 12px; + float: left; + padding-top: 6px; + width: 67px; + } + div.input + { + float: left; + width: 240px; + } + .txt + { + border-style: solid; + border-color: #BBBBBB; + border-width: 1px; + height: 25px; + width: 230px; + } + .note + { + clear: both; + padding: 3px; + line-height: 13px; + font-size: 12px; + color: #999999; + margin-left: 67px; + } + li + { + float: left; + margin-top: 20px; + width: 100%; + } + a:link + { + color: #336699; + text-decoration: none; + } + a:hover + { + color: #3399FF; + text-decoration: underline; + } + a:visited + { + color: #336699; + text-decoration: underline; + } + .check + { + font-size: 12px; + padding-top: 5px; + float: left; + } + #birth + { + font-size: 12px; + padding-top: 3px; + float: left; + } + #address + { + float: left; + width: 25px; + } + #address_select + { + height: 25px; + width: 139px; + } + #agree + { + margin-left: 67px; + margin-top: -5px; + font-size: 12px; + float: left; + } + #button + { + margin-left: 67px; + float: left; + } + #submit + { + width: 96px; + height: 24px; + background: #d32c47; + border-bottom: #951428 1px solid; + border-left: #fff 1px solid; + border-right: #951428 1px solid; + border-top: #fff 1px solid; + color: #fff; + } + b + { + font-size: 14px; + padding-top: 21px; + padding-left: 30px; + padding-right: 0px; + padding-bottom: 30px; + float: left; + width: 100%; + line-height: 19px; + } + .right_note + { + line-height: 19px; + font-size: 12px; + color: #999999; + margin-left: 30px; + text-align: left; + width: 100%; + } + #pic + { + margin-top: 12px; + margin-left: 30px; + width: 100%; + } + .image + { + border-style: solid; + border-color: #FFFFFF; + border-width: 0px; + } + .line + { + height: 1px; + margin-top: 25px; + background-color: #EEEEEE; + width: 100%; + } + #words + { + padding-left: 30px; + margin-top: 35px; + } + #words_h + { + font-family: ��Բ; + color: #DD4C4C; + font-size: 20px; + font-weight: bolder; + margin-bottom: 20px; + } + .words_p + { + font-family: ��Բ; + color: #808080; + font-size: 14px; + font-weight: bolder; + padding-bottom: 10px; + } + .words_span + { + color: #DD4C4C; + } + #footer_first + { + width: 100%; + height: 42px; + font-size: 12px; + border-style: solid; + border-color: #FFFFFF; + border-width: 0px; + } + .footer1_left + { + float: left; + height: 20px; + margin-top: 12px; + margin-left: -8px; + } + .footer1_right + { + float: right; + margin-top: 12px; + color: #999999; + } + .footer1left_a + { + margin-left: 8px; + margin-right: 8px; + } + #footer_second + { + background-color: rgb(240, 239, 239); + height: 27px; + font-size: 12px; + color: rgb(153,153,153); + width: 100%; + line-height: 27px; + text-align: left; + } + .footer2_one + { + margin-left: 40px; + } + .footer2_two + { + margin-left: 25px; + } \ No newline at end of file diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/css/validate.css b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/css/validate.css new file mode 100644 index 0000000..958d365 --- /dev/null +++ b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/css/validate.css @@ -0,0 +1,142 @@ +.tipFormatTrue { +padding: 2px 6px; +color:rgb(153, 153, 153); +background-color: rgb(249, 249, 249); +border: 1px solid rgb(221, 221, 221); +font-family: Arial; +font-size: 12px; +position: absolute; +left: 300px; +top: 0; +width: 178px; +} +.tipFormatFalse { +padding: 2px 6px; +color:rgb(221, 75, 57); +background-color:rgb(255, 229, 229); +border: 1px solid rgb(255, 183, 183); +font-family: Arial; +font-size: 12px; +position: absolute; +left: 300px; +top: 0; +width: 178px; +} +.autoemailstyle +{ + width:230px; + height:210px; + border:1px solid black; + float:right; + position:absolute; + left:67px; + top:26px; + background-color:#FFFFFF; + display:none; + z-index:3; +} +.manyemail +{ + font-size:12px; + color: rgb(153, 153, 153); + font-family: Arial; + height:19px; + cursor: pointer; +} +.rightStyle +{ + position:absolute; + left:305px; + top:5px; + display:none; +} +.cityStyle +{ + border-style: solid; + border-color: #BBBBBB; + border-width: 1px; + height: 25px; + width: 150px; + cursor:pointer; +} +.cityBg +{ + border: 1px solid rgb(201, 201, 201); + width:430px; + height:150px; + background-color:rgb(247, 247, 247); + position:absolute; + left:57px; + top:32px; + display:none; +} +.cbox +{ + border:1px solid rgb(200,200,200); + background-color: rgb(255, 255, 255); + color: rgb(0, 94, 172); + font-family: Arial; + font-size: 12px; + line-height: 21.6px; + margin-top:17px; + margin-left:17px; + margin-right:17px; + cursor:pointer; + height:90px; +} +.sl2 +{ + color: rgb(51, 102, 153); + line-height: 21.6px; + margin-left:8px; +} +.closebutton +{ + background-color: rgb(221, 221, 221); + border-width: 1px; + border-style: solid; + border-color: rgb(255, 255, 255) rgb(106, 106, 106) rgb(106, 106, 106) rgb(255, 255, 255); + height:25px; + width:35px; + cursor:pointer; + text-align: center; + float:right; + margin-right:17px; + margin-top:7px; +} +.dirdivstyle +{ + float:left; + width :33px; + height:41px; +} +.directionstyle +{ + border:1px solid rgb(201, 201, 201); + width:181px; + height:253px; + position:absolute; + left:-40px; + top:42px; + display:none; + cursor:pointer; +} +.leftdir +{ + width:90px; + height:28px; + float:left; + background-color:rgb(250,250,250); + border-right:1px solid rgb(201, 201, 201); + text-align:center; + line-height:30px; +} +.rightdir +{ + width:89px; + height:28px; + float:right; + background-color:rgb(250,250,250); + text-align:center; + line-height:30px; +} diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/error.gif b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/error.gif new file mode 100644 index 0000000..7b19490 Binary files /dev/null and b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/error.gif differ diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p1.jpg b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p1.jpg new file mode 100644 index 0000000..b09ade2 Binary files /dev/null and b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p1.jpg differ diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p2.jpg b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p2.jpg new file mode 100644 index 0000000..493e914 Binary files /dev/null and b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p2.jpg differ diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p3.jpg b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p3.jpg new file mode 100644 index 0000000..7aeb793 Binary files /dev/null and b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p3.jpg differ diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p4.jpg b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p4.jpg new file mode 100644 index 0000000..19bfc8f Binary files /dev/null and b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p4.jpg differ diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p5.jpg b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p5.jpg new file mode 100644 index 0000000..0965a5e Binary files /dev/null and b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/p5.jpg differ diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/right.gif b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/right.gif new file mode 100644 index 0000000..44abc2e Binary files /dev/null and b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/images/right.gif differ diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/kaixin.js b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/kaixin.js new file mode 100644 index 0000000..89ace7f --- /dev/null +++ b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/kaixin.js @@ -0,0 +1,333 @@ +window.addEvent =function(element,event,fn){ + if(element.addEventListener) + { + element.addEventListener(event,fn,false); + + } + else if(element.attachEvent){ + //��һ��������onclick��,��onload���ȵȣ��ڶ��������Ǿ�����¼����� + element.attachEvent("on"+event, function(){ fn.call(element) }); + + } +} + //isinfo��ʾ�ı����е������Ƿ����,������ʾʱ�Ƿ��̾��ͼƬ +function tip(title,isInfo,id) +{ + this.title=title; + this.isInfo=isInfo; + this.tipDom=document.getElementById(id); +} + +//��������function���岢������ִ�У�ִ�к󷵻ظ�tip������������showtip()��hidetip() +tip.prototype=(function() +{ + //���ɺ��ʵ�Tip���ڲ����� + function genTip(tipDomObject,title,isInfo) + { + if(isInfo===false) + { + tipDomObject.innerHTML="" + title + ""; + //���ı����е����ݴ���ʱ�޸�tip�ı���ɫ��������ɫ + tipDomObject.className="tipFormatFalse"; + } + else + { + //�ö����cssΪtipFormat + tipDomObject.className="tipFormatTrue"; + tipDomObject.innerHTML=""+title+""; + } + } + //������ �����ڴ˴�Ӧ��this + //alert(this.title+" in closure"); + return { + showTip:function() //�հ����� + { + genTip(this.tipDom,this.title,this.isInfo); + //alert(this.tipDom.innerHTML); + this.tipDom.style.display="block"; + }, + hideTip:function() + { + this.tipDom.style.display="none"; + } + } +})(); + + + +function prepareTip() + { + //ȡ��body���� + var bd=document.getElementsByTagName('body')[0]; + //�ر�ע��ð��ִ�У���ִ���Ǹ�С��div��click�¼���Ȼ����ִ��body��onclick + window.addEvent(bd,'click',autoemailhide); + var e=document.getElementById("email"); + //��email��һ���¼� + window.addEvent(e,'blur',blurFn); + window.addEvent(e,'focus',focusFn); + window.addEvent(e,'keypress',autoemailshow); + //����һ���ַ�ʱ������writeemail + window.addEvent(e,'keyup',writeEmail); + for(i=1;i<11;i++) + { + //�����е�С��������ʾ�����¼� + var mail=document.getElementById("mail"+i); + window.addEvent(mail,'mouseover',mailmouseover); + window.addEvent(mail,'mouseout',mailmouseout); + window.addEvent(mail,'click',writeOnText); + } + var n=document.getElementById("name"); + window.addEvent(n,'blur',blurFn); + window.addEvent(n,'focus',focusFn); + var p=document.getElementById("password"); + window.addEvent(p,'blur',blurFn); + window.addEvent(p,'focus',focusFn); + //��ѡ����а��¼� + var citytext=document.getElementById("city"); + window.addEvent(citytext,'click',showcity); + var closebutton=document.getElementById("closecity"); + window.addEvent(closebutton,'click',hidecity); + //�����еij��а��¼� + for(j=1;j<36;j++) + { + var selectcity=document.getElementById("city"+j); + window.addEvent(selectcity,'click',writeOnCity); + } + //���������еĵ��������¼� + var headdirdiv=document.getElementById("directiondiv"); + window.addEvent(headdirdiv,'mouseover',dirshow); + window.addEvent(headdirdiv,'mouseout',dirhide); + //���±ߵĴ�ĵ��������¼���ֹ��������ʧ + var direction=document.getElementById("direction"); + window.addEvent(direction,'mouseover',dirshow); + window.addEvent(direction,'mouseout',dirhide); + for(i=1;i<10;i++) + { + var littleDirLeft=document.getElementById("dleft"+i); + window.addEvent(littleDirLeft,'mouseover',alterRed); + window.addEvent(littleDirLeft,'mouseout',alterBackColor); + var littleDirRight=document.getElementById("dright"+i); + window.addEvent(littleDirRight,'mouseover',alterRed); + window.addEvent(littleDirRight,'mouseout',alterBackColor); + } + } + function alterRed() + { + this.style.backgroundColor="rgb(235, 75, 85)"; + } + function alterBackColor() + { + this.style.backgroundColor="rgb(250,250,250)"; + } + function dirshow() + { + var dir=document.getElementById("direction"); + var headdiv=document.getElementById("directiondiv") + headdiv.style.backgroundColor="#F04E58"; + dir.style.display="block"; + } + function dirhide() + { + var dir=document.getElementById("direction"); + var headdiv=document.getElementById("directiondiv") + headdiv.style.backgroundColor="rgb(228, 64, 73)"; + dir.style.display="none"; + } + function writeOnCity() + { + var citytext=document.getElementById("city"); + citytext.value=this.firstChild.nodeValue; + hidecity(); + var image=document.getElementById("rightimgcity"); + image.style.display="inline"; + } + function showcity() + { + var citydiv=document.getElementById("selctcity"); + citydiv.style.display="block"; + } + function hidecity() + { + var citydiv=document.getElementById("selctcity"); + citydiv.style.display="none"; + } + function autoemailshow() + { + + var ae=document.getElementById("autoemail"); + ae.style.display='block'; + } + function autoemailhide() + { + var ae=document.getElementById("autoemail"); + ae.style.display='none'; + } + function writeOnText() + { + //�ر�ע�⣡�������ʱ���ı����ʧȥ���㣬�����autoemail�Զ����� + var emailtext=document.getElementById("email"); + emailtext.value=this.innerHTML; + var emailtip=document.getElementById("emailtip"); + //�����ȫ�������Ҫ���ı��������ʾ�����أ��� + emailtip.style.display="none"; + } + function mailmouseover() + { + // var mail=document.getElementById(m.id); + this.style.backgroundColor="#f4f4f4"; + } + function mailmouseout() + { + // var mail=document.getElementById("mail1"); + this.style.backgroundColor="#FFFFFF"; + } + + function writeEmail() + { + var emailtextvalue=document.getElementById("email").value; + document.getElementById("mail1").innerHTML=emailtextvalue+"@qq.com"; + document.getElementById("mail2").innerHTML=emailtextvalue+"@126.com"; + document.getElementById("mail3").innerHTML=emailtextvalue+"@163.com"; + document.getElementById("mail4").innerHTML=emailtextvalue+"@sina.com"; + document.getElementById("mail5").innerHTML=emailtextvalue+"@sina.cn"; + document.getElementById("mail6").innerHTML=emailtextvalue+"@hotmail.com"; + document.getElementById("mail7").innerHTML=emailtextvalue+"@gmail.com"; + document.getElementById("mail8").innerHTML=emailtextvalue+"@sohu.cn"; + document.getElementById("mail9").innerHTML=emailtextvalue+"@yahoo.cn"; + document.getElementById("mail10").innerHTML=emailtextvalue+"@139.cn"; + } + function blurFn() + { + var title; + switch(this.id) + { + case "email": + title="����д��Ч��������"; + break; + case "password": + title="����Ӧ����6-20����ĸ�����ֻ������ַ����"; + break; + case "name": + title="����д�����ʵ��������"; + break; + } + var t=new tip(title,false,this.id+"tip"); + //�ȹر�ԭ����info tip + t.hideTip(); + //����д����ʱ���� error tip + if(checkFormat(this)) + { + hiderightimg(this.id); + t.showTip(); + } + else + showrightimg(this.id); + //���ı����е�����Ϊ��ʱ��Ҳ����ʾ��ɫ�ĶԺţ� + if(this.value.toString().length==0) + hiderightimg(this.id); + } + function showrightimg(id) + { + var img + switch(id) + { + case "email": + img=document.getElementById("rightimgemail"); + break; + case "password": + img=document.getElementById("rightimgpassword"); + break; + case "name": + img=document.getElementById("rightimgname"); + break; + } + img.style.display="inline"; + } + function hiderightimg(id) + { + // alert("��ִ��"); + var img + switch(id) + { + case "email": + img=document.getElementById("rightimgemail"); + break; + case "password": + img=document.getElementById("rightimgpassword"); + break; + case "name": + img=document.getElementById("rightimgname"); + break; + } + img.style.display="none"; + } + function checkFormat(o) + { + // o ��Ҫ����ʽ��dom���� +// alert(o.id); + var check=o.value.toString(); + switch(o.id) + { + case "email": + { + if(check.indexOf("@qq.com")>0) + return false; + else if(check.indexOf("@126.com")>0) + return false; + else if(check.indexOf("@163.com")>0) + return false; + else if(check.indexOf("@sina.com")>0) + return false; + else if(check.indexOf("@hotmail.com")>0) + return false; + else if(check.indexOf("@gmail.com")>0) + return false; + else if(check.indexOf("@sohu.cn")>0) + return false; + else if(check.indexOf("@yahoo.cn")>0) + return false; + else if(check.indexOf("@139.cn")>0) + return false; + //���ı���Ϊ��ʱҲ����ʾtip + else if(check.length==0) + return false; + else + return true; + } + break; + case "password": + { + if(check.length<6&&check.length!=0) + return true; + else + return false; + } + break; + case "name": + { //���������ʽ�ж��ı������Ƿ������� + if(/.*[u4e00-u9fa5]+.*$/.test(o.value)) + return true; + else + return false; + } + break; + } + } + function focusFn() + { + var title; + switch(this.id) + { + case "email": + title="����д��Ч�������䣬�Ƽ�ʹ��QQ����"; + break; + case "password": + title="��6-20����ĸ�����ֻ������ַ����"; + break; + case "name": + title="����д�����ʵ��������"; + break; + } + var t=new tip(title,true,this.id+"tip"); + t.showTip(); + } \ No newline at end of file diff --git a/2012-Autumn-Homework/KaixinJavascript/zhangguodong/kaixinJavaScript.html b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/kaixinJavaScript.html new file mode 100644 index 0000000..1027a58 --- /dev/null +++ b/2012-Autumn-Homework/KaixinJavascript/zhangguodong/kaixinJavaScript.html @@ -0,0 +1,300 @@ + + + + ������ + + + + + + + + + +
+
+
+ + kaixinlogo +
+
+
ע��
+
��¼
+
����
+ +
+
�ֻ���
��Ƭ
+
ת��
����
+
ͶƱ
��Ӱ
+
��¼
��Ƶ
+
ר��
���ļ�Ʒ
+
��
��ҳ��Ϸ
+
С��Ϸ
�罻��Ϸ
+
������ҳ
����
+
��������
��Ʒ�ۿ�
+
+
+
+
+
+
+

+ ʮ����뿪�������ҵ�ȫ������

+
+
+ +
+
+
+ ���ǿ������û���ֱ�ӵ�¼ +

+ ʹ�ú�����վ�˺ŵ�¼

+ +
+
+
+

+ ������

+

+ ƽ��ÿ��ӵ��80λ����

+

+ ÿ�죬ƽ��ÿ���ϴ�10����Ƭ

+

+ ÿ�죬��1000���λ����ں��Ѽ俪�ĵط�����

+

+ �й��˶��罻�����������˽⣬�����↑ʼ

+
+
+
+ +
+ +