我正在尝试用另一个替换我在 Intranet 站点上的选取框,但仅限于周五 8 点到 12 点之间的火警测试。
这是 JSFiddle 上的代码:http://jsfiddle.net/bmgh1985/7dKcN/ (我想要最终得到的版本也在那里,但更多的是为了清晰而不是永久地在页面上) 这是我到目前为止想出的 jQuery:
function firealarm() {
var d = new Date();
var x = d.getday();
var n = d.getHours();
if (n > 8 && n < 12 && x = 5)
$(‘.marqueeframe’).replaceWith('<marquee behavior="scroll" direction="left" scrollamount="5"><div class="falarm">The Fire Alarm will be tested this morning</div>><div class="falarm">The Fire Alarm will be tested this morning</div>><div class="falarm">The Fire Alarm will be tested this morning</div></marquee>');
}
window.onload = firealarm;
最佳答案
x = d.getDay(); x==5 是让它工作的变化
关于jquery - 每周定时更换HTML的功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17612715/