javascript - 使用 setInterval 时如何停止等待光标

标签 javascript html css

我有以下页面每 2 秒调用一个 javascript 函数(在本例中为 jsDoSomething):

<html>
   <head>..stuff...</head>
   <body onload="jsBodyOnload()">
      ...body...

      <script>
         function jsBodyOnload() {
            setInterval(jsDoSomething,2000);
         }
      </script>
   </body>
</html>

一切正常,但是在 setInterval 运行函数 jsDoSomething 期间,光标变为等待光标,然后在完成后返回默认值。如何阻止光标更改此函数运行的所有内容?我想在页面上始终保持光标相同(作为默认光标)。

谢谢。

最佳答案

事实证明这是 jsDoSomething 正在做的事情。它是一个 XAJAX 函数,该类中有一个选项允许我关闭等待光标。出于某种原因,我开始以为是 setInterval。

关于javascript - 使用 setInterval 时如何停止等待光标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47868779/

相关文章:

html - CSS 菜单 : Word wrap in sub menus

html - 用 chrome 打印时表格中的单元格高度奇怪

html - 在 overflow hidden 的父级中显示 div 元素

html - 普通类 - css margin-top 不工作

css - 如何让文本在 100% 宽的 div 上保持原位?

java - getParts() 也获取文本输入

javascript - dagre-d3/graphlib 中的 graph.hasEdge 函数

javascript - 为什么我的代码中需要 "return false"?

jQuery 裁剪图像并查看实时预览

javascript - 错误 : You called the draw() method with the wrong type of data rather than a DataTable or DataView