cost 360 ms
setInterval 不适用于 onmouseover - setInterval doesn’t work with onmouseover

我正在使用 luxon 获取一些不同时区的信息。 当鼠标悬停在内容 div 上时,它必须显示城市的当前时间,当调用 onmouseout 时,再次显示城市名称。 但不知何故 setInterval 不适用于 onmouseover function,它只保留停止时间信息。 我想要制作的是当我将鼠标 ...

onmouseover 和 onmouseout 帮助 - 无法持续执行 - onmouseover & onmouseout help - unable to continually to do it

这是我的代码,我正在尝试这样做,当我 hover 在图像上播放视频时,当你 hover 关闭时它停止视频并返回到原始图像。 问题是当我关闭 hover 时,我无法再次悬停以再次播放视频。 我想知道如何才能做到这一点,以便我可以 hover 在图像上不止一次播放视频。 我的编码如下: ...

HTML 和 Javascript - 将灰度应用于表格中的图像,然后将鼠标悬停在图像上 go 返回彩色版本 - HTML with Javascript - Apply grayscale to images in a table, then mouseover images to go back to colored version

我有一个关于在 javascript 中使用 mouseover / mouseout 事件以及将灰度应用于表格的问题。 问题说我必须首先在 html 中制作一个全灰色的图像网格(表格)。然后我需要将 javascript 添加到 html 以便当我将鼠标悬停在图像上时,图像变成彩色图像,当我将鼠标 ...

当您 hover 将鼠标悬停在文本上时,我应该更改文本颜色、大小和字体。 我怎样才能使这种情况持续发生? - i am supposed to change the text color, size, and font when you hover the mouse over the text. How can i made this happen continiuously?

mouseon Function 将文本更改为绿色,其 position。我还需要它来更改字体和大小。 当鼠标悬停在文本上时,我需要这两个功能一直发生。 我希望鼠标关闭 function 以使文本恢复正常。 ...

如何使用 vanilla JS 阻止 onmouseleave() 从“冒泡”到其他兄弟姐妹? - How to stop onmouseleave() from 'bubbling' to other siblings using vanilla JS?

我为一系列头部中的每个跨度标签设置了远程动画.gif 翻转——我使用<span>将头部垂直居中靠近图像(它实际上是相同的图像,我没有重构任何代码然而)。 第一个onmouseenter (或onmouseover ,我都尝试过)和onmouseleave (或onmouseout )事 ...

href 链接不适用于带有“onmouseover 更改文本”和 onmouseout 的 innerHTML 脚本 - href link not working with innerHTML script with "onmouseover change text" and onmouseout

我的目标是在鼠标悬停时将文本从“hello”(没有链接)更改为“Google”,并在生成的“Google”文本上提供 HREF,然后在没有链接的情况下恢复为“hello”onmouseout。 下面的代码用于将文本从“hello”更改为“Google”,但 1)“Google”上的链接不起作用(即使 ...

做了一个<div> display:block with onmouseover() 但我无法点击它,因为一旦我将鼠标移开,它就会因为 onmouseout() 而消失</div><div id="text_translate"><p>所以我做了一个 display: block 当鼠标悬停在某个时,并 display: none 当 cursor 移开时。 '</p><p> <a href="https://i.stack.imgur.com/hu3Zz.png" rel="nofollow noreferrer">我制作的 div 仅在鼠标悬停在某个链接上时显示</a></p><p> <a href="https://i.stack.imgur.com/afbPC.png" rel="nofollow noreferrer">div 有一个 display: none 当鼠标离开链接时</a></p><p>这是我用过的代码</p><p> HTML:</p><pre> &lt;a href="#" onmouseover="LoginShow()" onmouseout="LoginHide()"&gt;Login/Sign Up&lt;/a&gt;</pre><p> JavaScript:</p><pre> function LoginShow (){ document.getElementById("log").style.display="block";} function LoginHide(){ document.getElementById("log").style.display="none";}</pre><p> 但是我无法单击 div,因为一旦我尝试将 cursor 移动到 div 中的按钮,则 div 将不显示任何内容,因为我必须将 cursor 远离链接。</p><p> 我是 JS 新手,但我见过其他 web 页面这样做,div 在鼠标悬停时显示的方式是什么,可以单击并显示:只有当我离开 div 时才显示。</p><p> 我也试过</p><pre> &lt;a href="#" onmouseover="LoginShow()"&gt;Login/Sign Up&lt;/a&gt; &lt;div class="login" id="log" onmouseover="LoginShow()" onmouseout="LoginHide()"&gt;</pre><p> It kind of solves the problem, but for the div to go to display none I have to move the cursor away from the div, if the move the cursor away from the anchor tag, it doesn't go away.</p></div> - made a <div> display:block with onmouseover() but i can't click on it becasue as soon as I move my mouse away it disappears because of onmouseout()

所以我做了一个 display: block 当鼠标悬停在某个时,并 display: none 当 cursor 移开时。 ' 我制作的 div 仅在鼠标悬停在某个链接上时显示 div 有一个 display: none 当鼠标离开链接时这是我用过的代码 HTML: JavaScript: 但 ...

onMouseLeave/onMouseOut 有时会在页面刷新时触发 React - onMouseLeave/onMouseOut sometimes triggered on page refresh React

我有一个图像,当我将鼠标放在它上面时,会触发 onMouseOver 事件并出现动画。 然后当我从图像上离开鼠标时,动画结束。 这是我的代码片段,我使用的是 React 和 Mozilla Firefox: 问题是,有时当我刷新页面并将鼠标放在图像上时它运行良好,但有时在刷新 onMouseL ...

在图像上插入文本并通过将鼠标悬停在 (JavaScript) 上来更改文本 - Insert text over an image and change the text by hovering the mouse over (JavaScript)

我有这个 HTML 代码,我想在它的中心插入这个图像的描述性文本。 之后,我想通过将鼠标悬停在图像上来更改文本。 对此有什么想法吗? 我尝试了几种解决方案,但大多数都未能针对多张图像做到这一点,而不仅仅是一张。 ...

如何使用下面的 HTML 结构创建出现在悬停时的叠加层? - How to create an overlay that appears on hover with the HTML structure below?

现在,我正在创建一个覆盖 div 和一个具有以下结构的内容 div,其中覆盖 div 位于内容 div 的上方并且是绝对定位的。 我正在使用 Django 变量呈现覆盖和内容 div 的内容,并且在我的实际代码中,这些是使用 for 循环创建的,以呈现页面上的所有内容。 当用户将鼠标悬停在特定的内 ...

onmouseout 不起作用,但是 onmouseover 是 - onmouseout not working, however onmouseover is

抱歉,如果你看到这篇文章两次,我觉得我可以更好地解释事情。 基本上,我正在创建一个页面,其中有一堆元素,当鼠标悬停在它上面时,一个“状态”框将覆盖在它上面,当鼠标离开时,它会再次消失。 通过 Django,我传递了一个带有每个项目的标识符代码和规格的 python 字典,规格本身是另一个字典,具有 ...

onmouseover 函数有效,但 onmouseout 函数无效? - onmouseover function working, but onmouseout function is not?

现在我正在尝试在另一个元素悬停时显示一个覆盖 div,我正在使用onmouseout和onmouseover属性来执行此操作。 在最初显示的元素中,我有一个带有唯一项目代码的 h1 和项目的图像。 我还有另一个设置为display: none的 div,默认情况下,id 是与项目对应的代码。 我希望 ...

当 DIV 有子 DIV 时,如何在 DIV 上使用 Javascript onmouseout - How to use Javascript onmouseout on a DIV when it has child DIVs

我正在开发一个用于学习目的的网站。 我在右上角创建了一个菜单按钮,如下面的屏幕截图所示。 下面的屏幕截图显示了触发菜单按钮时页面的外观。 您可以看到展开的菜单面板中有 3 个分区。 我正在尝试使用 javascript onmouseout 在将鼠标移到 DIV 外时自动隐藏菜单。 但是一旦 ...

在 img onmouseover function 中使用这个和 document.getElementById - Using this and document.getElementById within an img onmouseover function

我正在尝试使用onmouseover和onmouseout更改 h2 中的图像和文本,就像在这个 gif 中一样 我在下面给出了一些示例,我可以使用onmouseover和onmouseout使用this或document.getElementById更改图像,但是当我使用this时,我无法弄清楚 ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM