jquery - 每周定时更换HTML的功能

标签 jquery html css

我正在尝试用另一个替换我在 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/

相关文章:

css - “text-decoration” 和 “:after” 伪元素,重访

javascript - 使用 JS/jQuery 在跨度中查找并包装 <br><br>

jquery - 覆盖时防止主体滚动,默认情况下主体为 'overflow: scroll'

javascript - Bootstrap 4 网格与模式和轮播

html - 图像上从上到下的线性渐变(黑色),前景上有文本(左下)

javascript - 我们应该告诉 browsersync 重新加载特定的资源类型吗?

html - 为什么照片库在移动版本中不对齐?

javascript - 如何在自定义过滤器函数中添加两个输入值

jquery - Html单选按钮选择

javascript - 提交表单时如何用javascript显示隐藏的div?