网站登陆事件js源代码文档格式.docx

上传人:b****2 文档编号:15320651 上传时间:2022-10-29 格式:DOCX 页数:12 大小:17.46KB
下载 相关 举报
网站登陆事件js源代码文档格式.docx_第1页
第1页 / 共12页
网站登陆事件js源代码文档格式.docx_第2页
第2页 / 共12页
网站登陆事件js源代码文档格式.docx_第3页
第3页 / 共12页
网站登陆事件js源代码文档格式.docx_第4页
第4页 / 共12页
网站登陆事件js源代码文档格式.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

网站登陆事件js源代码文档格式.docx

《网站登陆事件js源代码文档格式.docx》由会员分享,可在线阅读,更多相关《网站登陆事件js源代码文档格式.docx(12页珍藏版)》请在冰豆网上搜索。

网站登陆事件js源代码文档格式.docx

/b>

/font>

/h2>

hrwidth=300>

!

--案例代码开始-->

formname=forms>

CENTER>

divalign=center>

p>

fontsize=3>

--[Step1]:

这里可以设置页面显示的内容、颜色及大小-->

fontcolor=redsize=3>

您已登录本站<

fontcolor=#80FF80>

inputtype=textname=input1size=10>

/p>

/div>

/center>

SCRIPTlanguage=javascript>

varsec=0;

varmin=0;

varhou=0;

flag=0;

idt=window.setTimeout("

UpDate();

"

1000);

functionUpDate(){

sec++;

if(sec==60){sec=0;

min+=1;

}

if(min==60){min=0;

hou+=1;

if((min>

0)&

&

(flag==0))

--[Step2]:

在此可以设置弹出窗口的显示信息-->

{window.alert("

您已经逗留了1分钟!

可别忙着走呀,还有很多好东东等着您呢!

);

flag=1;

document.forms.input1.value=hou+"

时"

+min+"

分"

+sec+"

秒"

;

/SCRIPT>

/form>

--案例代码结束-->

/BODY>

/HTML>

2浏览某页所用的时间

时间日期篇--浏览某页所用时间<

onload=Timetrack()>

--案例代码1开始-->

scriptlanguage=javascript>

varentered=newDate()

functionTimetrack(){

varnow=newDate()

varseconds=Math.floor((now.getTime()-entered.getTime())/1000)

varminutes=Math.floor(seconds/60)

varsecond=seconds%60

varminute=minutes%60

document.time.timer.value=minutes+"

:

+seconds

vartimeID=setTimeout("

Timetrack()"

1000)

/script>

--案例代码1结束-->

--案例代码2开始-->

table>

tr>

tdWIDTH="

100%"

fontFACE="

ARIEL,HELVETICA"

SIZE="

-1"

formNAME="

time"

这里可以更该页面显示的信息-->

这里可以设置显示时间的列长度-->

divalign="

center"

浏览本页总共用去<

inputTYPE="

text"

NAME="

timer"

6"

VALUE="

0:

00"

秒.<

/td>

/tr>

/table>

--案例代码2结束-->

3退出时显示访问时间

时间日期篇--退出时显示访问时间<

onunload=SeeYouLater()>

scriptlanguage="

JavaScript"

pageOpen=newDate();

functionSeeYouLater(){

pageClose=newDate();

minutes=(pageClose.getMinutes()-pageOpen.getMinutes());

seconds=(pageClose.getSeconds()-pageOpen.getSeconds());

time=(seconds+(minutes*60));

这里可以改变弹出窗口显示的信息-->

alert('

您在这里逗留了'

+time+'

秒。

欢迎再次光临!

'

}

4显示全中文日期

时间日期篇--显示全中文日期<

functionCurrentDate(point)

{

varnumberstring="

一二三四五六七八九十"

if(point==0){document.write("

十"

)}

if(point<

10){document.write(numberstring.substring(0+(point-1),point))}

else

20){document.write("

+numberstring.substring(0+(point-11),(point-10)))}

30){document.write("

二十"

+numberstring.substring(0+(point-21),(point-20)))}

else{document.write("

三十"

+numberstring.substring(0+(point-31),(point-30)))}

}

vartoday=newDate()

varmonth=today.getMonth()+1

vardate=today.getDate()

varday=today.getDay()

在此可以更该显示的年份-->

document.write("

公元二零零二年"

CurrentDate(month)

月"

CurrentDate(date)

日"

5倒计时

时间日期篇--倒计时1<

onLoad=DownCount()>

scriptlanguage=JavaScript>

这里可以设置倒计时的月日年-->

vartheDay=newDate("

January1,2008"

varDayALL

functionDownCount(){

vartoday=newDate()

varseconds=Math.floor((theDay.getTime()-today.getTime())/1000)

varminutes=Math.floor(seconds/60)

varhours=Math.floor(minutes/60)

vardays=Math.floor(hours/24)

CDay=days

CHour=hours%24

CMinute=minutes%60

CSecond=seconds%60

DayALL=CDay+"

天,"

+CHour+"

小时,"

+CMinute+"

分钟,"

+CSecond+"

秒"

document.clock.DownCount.value=DayALL

varcounter=setTimeout("

DownCount()"

1000)

 

formname="

clock"

这里可以更该页面上显示的提示信息-->

距离2008年1月1日,您将还有<

--[Step3]:

这里可以改变时间的列长度-->

inputtype="

TEXT"

name="

DownCount"

size="

35"

6倒计时

时间日期篇--倒计时2<

onload=DownTime()>

scriptlanguage='

Javascript'

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 工程科技 > 冶金矿山地质

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1