孟垂博自媒体博客|只做精品

首页 > 网站教程 > js效果  >  jquery根据时间判断,特定日期跳转对应页面

var nowtime=new Date();

var day=checkTime(nowtime.getDate());

function checkTime(dayi)

{

if (dayi<10)

{dayi="0" + dayi}

return dayi;

}

var hours =nowtime.getHours();

var dayone="11 12 13 14 17 18 19 20 21";

if(dayone.indexOf(day)>=0&&(hours<9||hours>20)){

document.writeln("<script>function openZoosUrl(){window.location.href='/ztweb/yuyue.html';}</script>");

}else if(day==15&&(hours<9||hours>16)){

document.writeln("<script>function openZoosUrl(){window.location.href='/ztweb/yuyue.html';}</script>");

}else if(day==16){

document.writeln("<script>function openZoosUrl(){window.location.href='/ztweb/yuyue.html';}</script>");

}

    分享:

    微信

    相关文章

    发表评论