⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.js

📁 是个不错的文件代码,希望大家好好用,
💻 JS
字号:
//下面是在页面上输出时间的函数
function showdate() {
today=new Date();
var day; var date; var hello; var wel;
hour=new Date().getHours()
if(hour < 4)hello='夜猫子';
else if(hour < 6)hello='凌晨好';
else if(hour < 9)hello='早上好';
else if(hour < 12)hello='上午好';
else if(hour < 14)hello='中午好';
else if(hour < 17)hello='下午好';
else if(hour < 19)hello='傍晚好';
else if(hour < 22)hello='晚上好';
else if(hour < 23)hello='夜里好';
else {hello='该休息了!';}
if(today.getDay()==0)day='周未';
else if(today.getDay()==1)day='周一';
else if(today.getDay()==2)day='周二';
else if(today.getDay()==3)day='周三';
else if(today.getDay()==4)day='周四';
else if(today.getDay()==5)day='周五';
else if(today.getDay()==6)day='周六';
date=(today.getMonth()+1 ) + '月' + today.getDate() + '号';
if(hour<1)wel='子时';
else if(hour<3)wel='丑时';
else if(hour<5)wel='寅时';
else if(hour<7)wel='卯时';
else if(hour<9)wel='辰时';
else if(hour<11)wel='巳时';
else if(hour<13)wel='午时';
else if(hour<15)wel='未时';
else if(hour<17)wel='申时';
else if(hour<19)wel='酉时';
else if(hour<21)wel='戌时';
else if(hour<23)wel='亥时';
else {wel='子时';}
document.write(hello + ' ' + date + ' ' + day + ' 时辰 ' + wel);
}


function SetHome()//设置为首页的函数
{
	document.links[0].style.behavior='url(#default#homepage)';
	document.links[0].setHomePage('http://52.La');
}

function SetHome_Url(url)//设置为首页的函数,可自定义首页的URL地址
{
	document.links[0].style.behavior='url(#default#homepage)';
	document.links[0].setHomePage(url);
}

function AddFav()//加入收藏夹函数
{
	window.external.addFavorite('http://52.La','--我爱啦(52.La) 多功能查询--')
} 

//弹出新窗口的JS
function openwin(url,thetitle,width,height,scrollbars){
	var scrollval
	if (scrollbars!=1){scrollval = "no";}else{scrollval = "yes";}
    var w = 1024;
    var h = 768;
    if (document.all || document.layers){
        w = screen.availWidth;
        h = screen.availHeight;
    }
    var leftPos = (w/2-width/1.5);
    var topPos = (h/2.3-height/2);
    window.open(url,thetitle,"width="+width+",height="+height+",top="+topPos+",left="+leftPos+",scrollbars="+scrollval+",resizable=no,status=no")
}

//弹出窗口,注意,与上面的不同哦?
function openModwin(winUrl,winWidth,winHeight) {
showModelessDialog(winUrl,'52_La',"dialogWidth:"+winWidth+"px;dialogHeight:"+winHeight+"px;dialogLeft:150px;dialogTop:100px;status:no;center:no;help:no;resizable:no;");
}

function SetDefault()//设置用户默认选项
{
	openwin("SetDefault.asp","52_La_User",480,245,1);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -