问题标签 [jquery-hover]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
231 浏览

javascript - addClass() to specific elements within a containing wrapper

I have been wracking my brains as to how to achieve this. I have a containing element, which has two separate a tags within it that I want to addClass() to (i.e. when I hover over one a tag, it adds the class to that one, and the other a tag within that containing element). I kind of had it by using the below code:

However I only want the hover triggered when on the 'a' itself, not on the entire element. Unfortunately, when I use this method:

It only adds the class to the first 'a' tag.

Any advice would be greatly appreciated.

0 投票
4 回答
345 浏览

jquery - 这个的简写是什么?

这是一些乱七八糟的javascript:

我怎样才能使这个更小,而不是缩小,但是没有办法说 like"toggle"而不是"mouseover"then "mouseout"

谢谢

0 投票
1 回答
1353 浏览

jquery - 在jquery上检测一个元素在另一个元素后面的悬停

我有一个具有渐变图像的 div,它位于另一个包含大量图像的 div 之上...

问题是我想检测用户何时悬停其中一张图像,因为如果发生这种情况,我想将悬停的图像放在前面。

顺便说一句,后面的 div 可以有很多图像(比如 60 个)。

我怎样才能做到这一点?

0 投票
2 回答
537 浏览

javascript - Hovercards 和 jQuery ..Hovercards 没有出现

我正在将此插件用于悬停卡..http://designwithpc.com/Plugins/Hovercard

这个插件的问题是,当我将鼠标悬停在“A”标签上时,它只显示最后一个“A”标签的值,而不是预期的值,并且

例如

预期:当我将链接悬停在 AAA.com 上时,它应该显示 AAA.com,但它显示的是 CCC.com

代码:

这里的问题是,当您将鼠标悬停在 AAA.com 上时,警报消息未显示 aaa.com,它向我们显示 CCC.com 有时仅显示第一个链接悬停但太错误了..

0 投票
3 回答
281 浏览

jquery - jQuery 将 .hover() 添加到每个锚点,除了那些已经生效的锚点

我想将 .hover() 添加到我网站中的每个锚点,除了那些已经有 .hover() [之前单独添加 .hover() 的锚点]。

我不知道如何在 jQuery 中或者如果可能的话。
如果它不可能,我有另一个想法,但同样,我不知道该怎么做或者它是否可能。

这个想法是这样的:我可以为每个锚添加 .hover() 效果,除了那些在父 div 中,id 为“test”,而那些在父 div 中,id 为“test2”?

谢谢!。

0 投票
0 回答
218 浏览

jquery - 如何根据父窗口大小调整悬停窗口大小

这是一个例子

http://textonly.in/test3.php

当您将鼠标悬停在任何链接上时,将弹出一个窗口..(它将加载文本)

问题是我应该能够根据元素(链接)的位置调整窗口大小/重新定位窗口,这是否可能?

到目前为止,我正在根据元素定位悬停窗口。如果元素大于(宽度/ 2),悬停将显示在左侧,如果不悬停将显示在左侧。

如何根据顶部和底部定位悬停窗口?

0 投票
1 回答
808 浏览

jquery - 如何使用 jQuery 将悬停动画添加到已经动画的图像链接?

我有一个“ul”的图像链接动画来不断移动,我想知道当鼠标悬停在它们上面时是否有办法添加另一个动画。

图像放置在 div 中并缩小到 div 大小,我想让它们在悬停时放大,而不停止原始动画。

我已经尝试了所有我能想到的方法,但我才刚刚开始使用 jQuery,我无法弄清楚这一点。

这是链接: http ://cqweblab.com/azbuka/azbuka.html

和代码。HTML:

CSS:

和 jQuery:

任何帮助将非常感激。

0 投票
1 回答
131 浏览

jquery - 没有 UI 的 jquery fadeIn 类解决方法

我似乎无法从这段代码中获取我需要的东西并让它为自己工作,希望有人能提供帮助。

我不能使用 Jquery UI 并且使悬停比他们需要的要困难得多。我有一个精灵,我需要淡入和淡出悬停。.css() 不允许淡入淡出,它是一个被 bg 位置调用的精灵

我的计划是在 mouseenter/leave 或 hover 上添加/删除一个类。这部分很容易,获得缓动效果则不然。这是他们的代码。我将如何使用这样的东西来添加和删除一个类,以便我可以淡入它来伪造动画/定时悬停?

我正在使用的 css 只是这样的:

0 投票
1 回答
824 浏览

jquery - jQuery 悬停动画继续运行。Stop() 变体无济于事

我对这段代码有奇怪的问题

我无法弄清楚为什么效果会一直上下波动并且不会停止。我尝试stop()过各种参数。和clearQueue()。但似乎没有任何帮助。

基本思想是当鼠标悬停图像上滑标题时。并一直停留直到鼠标完全离开图像,然后向下滑动。

任何想法我做错了什么?

现场示例http://jsfiddle.net/zSAYZ/

如果鼠标保持不动,带有最新 Chrome on Mac 标题的 PS 不会向下滑动。Whit 最新的 Firefox 标题只是 op 和 down 直到鼠标悬停图像。

0 投票
1 回答
1271 浏览

jquery - jquery submenu
  • fadeIn one after the other on hover
  • I have a pop-up submenu that when you hover your mouse over the parent <li> each child <li> fades in individually. And when your mouse leaves, the entire can just fade out at once.

    So far, I can fadeIn them individually using really bad jQuery code, but it only fires once. And the fadeOut has never worked. It never worked when I just had the entire pop-up menu fading in at the same time.

    Here it is in the current state: http://www.fixxed.net/test/pg/carousel/profiles.html

    Here's the jQuery code:

    Here's a simplified version of the HTML:

    I believe the reason it is not fading out when the mouse leaves is because of the CSS. There's a lot going with the CSS since it's a pop-up menu instead of a drop-down but here it all is (except for the sprite stuff):