我所说的突出显示是指当您将鼠标拖动到文本上时对文本所做的操作。如果你使用 imgur.com 那么你就知道我想要什么。我在任何地方都找不到任何关于此的信息,这令人沮丧。帮助?
编辑:好吧,我以为我已经说得足够清楚了,但我想还不够。我并不是说我想改变悬停时的背景颜色。那是微不足道的。但是您知道当页面上有文本时,您单击文本并拖动鼠标,或者按 ctrl+A,背景颜色会发生变化,然后您可以复制文本吗?你知道吗,突出显示?选择?我不希望它看起来像是通过更改背景颜色而发生的,我希望它确实发生。在 imgur.com 上上传一张图片,您就会明白我的意思。请注意,当您将鼠标悬停在上传图像的任何链接上时,文本将被选中 - 您可以复制它。
这就是为什么很难找到有关此的任何信息。我得到的只是如何更改背景颜色的结果。
$('#categories').hover(
function() {
$(this).find('#menulist').show();
},
function() {
$(this).find('#menulist').hide();
}
)
Run Code Online (Sandbox Code Playgroud)
我还应该在悬停函数中添加什么来更改边框半径属性?
我有带有6个按钮的GridView,当用户到达特定按钮的边缘时,我需要检测当前用户的哪个按钮用手指振动.是否可以在GridView的按钮层以某种方式进行,或者更好地在我的gridview中实现它并计算每个按钮边缘的坐标?
是否可以使用 JavaScript 事件模拟悬停?我尝试在目标元素上注入鼠标悬停事件,但没有运气。
例如,如果有一个带有悬停选择器的链接,是否可以使用 JavaScript 事件“悬停”在它上面?基本上,我想触发 CSS 悬停。你可以假设我不能使用 jQuery。
我希望当容器小部件获得focus/visible时工具提示默认可见。
我希望工具提示显示而无需将鼠标悬停在相应的控件上。
我有一个类为 .theClass 的表。该表只有两列。
是否可以选择整列并在悬停事件中影响整列?
想要在该列的任何 td 悬停时更改列中所有 td 的背景颜色。
提前谢谢了!
我有一个带有悬停状态的简单菜单:
<nav id="menu">
<div><a href="#">Home</a></div>
<div>
<a href="#">1</a>
<nav>
<div><a href="#">1.1</a></div>
<div><a href="#">1.2</a></div>
<div><a href="#">1.3</a></div>
</nav>
</div>
</nav>
Run Code Online (Sandbox Code Playgroud)
CSS:
#menu > div > nav {
display: none;
position: absolute;
z-index: 9999;
}
#menu > div:hover > nav {
display: block;
}
Run Code Online (Sandbox Code Playgroud)
但是 :hover 状态永远不会结束。再次点击(其他地方)后:悬停仍然停留。我可以在没有 javascript 的情况下解决这个问题吗?(小提琴)
似乎摆脱 :hover 的唯一方法是 :focus 某个地方 ( element.focus()) 或悬停在其他地方。
我有一些缩略图,我想在悬停时在它们上显示一些文本。我可以在悬停时使它们变暗,但不知道如何添加文本。
示例:http : //www.lenzflare.com/video-production-portfolio/
这是我所做的:
a {
display: inline-block;
overflow: hidden;
position: relative;
}
a:hover .play {
background:url(http://goo.gl/yJqCOR) no-repeat center center;
opacity: 0.8;
position: absolute;
width: 200px;
height: 200px;
left: 50%;
top: 50%;
margin-left: -110px;
margin-top: -150px;
}
<a href="/">
<div class="play"></div>
<img class="img" src="http://i42.tinypic.com/2v9zuc1.jpg" />
<br />
</a>
Run Code Online (Sandbox Code Playgroud)
当 mousOver 在 img 上时,我正在使用 jquery 代码来显示和隐藏文本 div。它工作正常,但是当显示 div 时,当 mouseOver div 时,它会隐藏并在 mouseOver 时再次显示。我想要做的是在鼠标悬停在图像上时显示 div,当鼠标悬停在图像内和 div 未隐藏的文本 div 上时,我希望 div 仅在鼠标离开 img 时隐藏。问题是我猜是因为我的 div 是 position:absolute,但我必须保留这个。
这是我的 jquery:
$(".image_big").hover(function(){
$('.cartouche').show();
},function(){
$('.cartouche').hide();
});
Run Code Online (Sandbox Code Playgroud)
和我的 CSS :
.cartouche {display:none;position: absolute;
bottom: 0px;
background-color: #00B252;
color: white;
text-transform: uppercase;
text-align: left;padding: 10px}
.image_big_container{width:473px;height:330px;text-align: center;}
#slideshow{margin-top: 20px;position:relative}
#slideshow_big { margin-bottom:10px}
Run Code Online (Sandbox Code Playgroud)
这是 JSfiddle 来查看它的实际效果:
http://jsfiddle.net/m7zFb/352/
我的网站上也会有很多图像,并且只想从所选图像中显示文本 div,有没有办法添加 this.children 以仅定位我是 mouseOver 的图像?
希望你明白我的问题,
感谢您的帮助
目前我正在为网上商店制作评级系统。基本上我希望它如何工作:
如果访问者以前从未评价过:
我使用的字体很棒,所以我没有使用任何图像。现在的问题是,如果我将鼠标悬停在一颗星星上,它可以工作,但如果我想从一颗星星移动到另一颗星星,它就会出现故障(因为星星之间有一点间隙,这意味着它会先重置星星)。
jsfiddle:https ://jsfiddle.net/uappvz3y/
JS:
var current_star_statusses = [];
star_elements = $('.fa-star');
star_elements.each(function(i, elem)
{
current_star_statusses.push($(elem).hasClass('yellow'));
});
star_elements.mouseenter(changeRatingStars);
star_elements.mouseleave(resetRatingStars);
/**
* Changes the rating star colors when hovering over it.
*/
function changeRatingStars()
{
// Current star hovered
var star = $(this);
// Removes all colors first from all stars
$('.fa-star').removeClass('gray').removeClass('yellow');
// Makes the current hovered star yellow
star.addClass('yellow');
// Makes the previous stars yellow and the next stars gray
star.parent().prevAll().children('.fa-star').addClass('yellow');
star.parent().nextAll().children('.fa-star').addClass('gray');
}
/** …Run Code Online (Sandbox Code Playgroud)