Top    Diary    Nostalgia    Book    Music    Film    GO    Animal    En    Gre    SS    TF    Design    Beauty    My   
 June 2026
SuMTuWThFSa
123456
78910111213
14151617181920
21222324252627
282930
3 MONTH 4  3 YEAR 4
  注册 登录
  ID: PW:   
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Information
共有日志:383
共有评论:6630
注册用户:23
访问次数:
排序方式:

New Comment
1. Современные цифровые те...
2. Best Live Casinos (onli...
3. Модули для гардеробной ...
4. Фитнес клубы у метро Бе...
5. Подайте заявку на микро...
More...

Search

  
搜索评论:
  

My Fields
+ 蓮の素材工房
Water Nymph Material Studio

+ 旬の類王子樣
+ 原新浪Blog(已停用)

Friends' Blogs
+ 蛙蛙的池塘
+ 都都猫的图片世界
+ Forsaken innocence
+ 王老师的网易Blog
+ 夏曲格桑美朵
+ 琦琦的空间

---------------------------------


+ 小栗旬Official Web Site
+ 栗子応援

3段实用的JavaScript脚本分享  [2008-6-2]  
心情指数#4
      以前自己写的3段JavaScript脚本,今天偶然翻到,贴出来给大家分享。 (比较实用,放在论坛或者博客都可以)
倒计时(只适用于对同一月内某一天的倒计时,跨月无效)

var calendar = new Date();
var date = 30 - calendar.getDate();
if (date > 0) 
   document.write("<font style='color:#0aa4ec; font-size:9pt; font-family: Comic Sans MS, Arial, Helvetica, sans-serif;'>","5月30日倒计时中...... 还有" + "<font color=737373>",date,"</font>" + "天","</font>"); 
if (date == 0) 
   document.write("<font style='color:#0aa4ec; font-size:9pt; font-family: Comic Sans MS, Arial, Helvetica, sans-serif;'>","今天是5月30日!","</font>"); 

显示希腊时间(按固定时差6小时计算,未考虑夏令时的自动调整)

function GreekClock() 
{if (!document.layers && !document.all) return; var runTime = new Date();
var hours = runTime.getHours()-6; var minutes = runTime.getMinutes(); 
var seconds = runTime.getSeconds(); var dn = "AM";
if (hours < 0) {hours = hours + 24;}
if (hours >= 12) {dn = 'PM';hours = hours - 12;} 
if (hours == 0 && dn == 'PM') {hours = 12;} 
if (minutes <= 9) {minutes = '0' + minutes;} 
if (seconds <= 9) {seconds = '0' + seconds;} 
movingtime = "<font color=#70bafe style='font-size:8.5pt;font-family:verdana'>" + hours + ":" + minutes + ":" + seconds + " " + dn + "</font>";
if (document.layers) {document.layers.Myclock.document.write(movingtime); document.layers.Myclock.document.close();}else if (document.all) {Myclock.innerHTML = movingtime;} setTimeout("GreekClock()", 1000);}window.onload = GreekClock;

英文显示星期、日期

<script>
today = new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[ i ] }
var d = new initArray(
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat");
var m = new initArray(
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec");
var n=today.getDate();
var orn = 'th';
{
if (n == 1 || n== 11 || n == 21 || n == 31) {orn = 'st';}
else if (n == 2 || n== 12 || n == 22) {orn = 'nd';}
else if (n == 3 || n== 13 || n == 23) {orn = 'rd';}
}
document.write(
m[today.getMonth()+1]," ",
today.getDate(),orn,", ",
today.getYear(),"&nbsp;&nbsp;",
d[today.getDay()+1]);
</script>

      看完代码感慨:原来现在的我已经退化了………………
[Edit on 2008-11-01 22:49:16 By Jasmine]
[ from 本站原创 ]
By [Jasmine] at 22:04:46 | Comments [1037] | TrackBack[0] | 5237 views

  ] 相关评论 ]
此篇日志暂时没有相关的说明和评论~~

  ] 发表评论 ]
  昵称: *头像:   预览: 头像
*验证码:  
  密码: 同时注册
禁止表情转换 禁止UBB缩放输入框: 6 5
表情:
312.500 ms