在悬停时,我想在图像的右上角有一个链接.就像你在Facebook上的个人资料图片上所说的"改变图片"一样.
我试图让它使用一些jquery,但没有运气,因为它没有图像的右侧.图像将是不同的大小,因为它们是个人资料图片.无论大小如何,它都需要保持在图像的右上角.
JQuery的:
$(".imgHover").hover(function() {
$(this).children("img").fadeTo(200, 0.25)
.end().children(".hover").show();
}, function() {
$(this).children("img").fadeTo(200, 1)
.end().children(".hover").hide();
});
Run Code Online (Sandbox Code Playgroud)
HTML:
<div class="imgHover">
<div class="hover"><a href="htpp://google.com">Edit</a></div>
<img src="http://img14.imageshack.us/img14/9698/29588166.jpg" alt="" />
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.imgHover .hover {
display: none;
position:absolute;
z-index: 2;
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
两个inline-block元素彼此相邻.
.e{border:1px #ccc solid}
.e:hover{border-color:#555}
Run Code Online (Sandbox Code Playgroud)
我想是在减少1px+ 1px它们之间的边界到共享1px边框.
为了显示.
---------
| | |
---------
Run Code Online (Sandbox Code Playgroud)
选择第一个元素.
+++++-----
+ + |
+++++-----
Run Code Online (Sandbox Code Playgroud)
选择第二个元素.
-----+++++
| + +
-----+++++
Run Code Online (Sandbox Code Playgroud)
这是简单的减少2px边境1px设置要么border-right或者border-left到0,但如何保持1px选择任一元素时共享边框?
没有JavaScript.
我正在构建一个应用程序,允许您通过单击它们将列表项从一个列表移动到另一个列表.但是,为了让用户知道clik的预期动作是什么,我在CSS中设置了一个:悬停状态,显示诸如"<< move"之类的指令
然而,我发现的问题是,在Internet Explorer(测试版本7-9)中,当我移动DOM元素时:该元素的悬停状态保持(变得粘滞),即使鼠标移动也是如此.:当用户将鼠标悬停在其新位置的项目上然后将鼠标移开时,悬停状态才会消失.这似乎是Internet Explorer唯一的问题.
如果您使用IE浏览器,请访问http://jsfiddle.net/hc2Eu/32/
当然有一种解决方法是不使用CSS:悬停状态并使用JQuery悬停事件代替,但这肯定不是最好的做事方式,并保持元素:在CSS中控制的悬停状态是远远的最强有力的做法.解决方法可以在http://jsfiddle.net/hc2Eu/29/上看到
有没有人想出我怎么能告诉Internet Explorer某个元素不再在鼠标下面,它应该释放:悬停状态?
马特
我只是想知道你是否不改变值,做hover,active并focus自动从标准a标签继承设置?
例如:
.wrapper .left .main .row .holder .more a,
#content .wrapper .left .main .row .holder .more a:visited
{
width: 92px;
min-width: 92px;
max-width: 92px;
height: 23px;
min-height: 23px;
max-height: 23px;
display: block;
margin: 0px auto;
background: #fff url(../images/more-info-btn.png) top left no-repeat;
}
#content .wrapper .left .main .row .holder .more a:hover {
width: 92px;
min-width: 92px;
max-width: 92px;
height: 23px;
min-height: 23px;
max-height: 23px;
display: block;
margin: 0px auto;
background: #fff url(../images/more-info-btn.png) bottom …Run Code Online (Sandbox Code Playgroud) 我有一个div,显示一系列幻灯片,一次一个.它包含框底部的链接,触发切换到下一张幻灯片.单击链接时,该框显示下一张幻灯片,并且框的高度在大部分时间都会更改.
我有一个:hover应用于链接的样式,但是一旦框的高度发生变化并且链接从鼠标下方移出,它将保持其:hover状态,直到它再次悬停.
我已经尝试过调用.mouseleave()并.mouseenter().mouseleave()在更改完成后,但它没有任何效果.我还创建了一个不同的:active与:focus您的链接,我可以看到该链接被点击时的闪光灯状态,但随后返回:hover.一个:visited风格也无济于事.
我知道IE的旧版本中有一个常见的错误类似于此,但我也看到这种情况发生在Chrome和Firefox中.
这是一个jsfiddle.
有任何想法吗?
我试图在悬停时更改xaml中按钮样式的背景颜色这是我当前的方法,但它不起作用.正在使用默认的悬停颜色
<Style x:Key="AtStyle" TargetType="Button">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{StaticResource AtBlue}" />
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="White" />
<Setter Property="Padding" Value="12,6" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontSize" Value="18.667" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="Red" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
Run Code Online (Sandbox Code Playgroud)
我已经看到其他解决方案,你需要覆盖控制模板来实现这一点,但这些解决方案还需要你定义边框和内容,这似乎是不必要的.在Xaml中定义悬停状态的最小方法是什么?
我有一个带链接的图像库.
编辑:这是我必须使用的代码:
<div class="gallerypagetabs"><a href="http://costumingdiary.blogspot.com/2013/01/victorian-tardis-purse.html"><img alt="Free Victorian Purse Pattern" src="https://lh3.googleusercontent.com/-m4y6eS2KGRQ/Ug7TKD3sbYI/AAAAAAAAHNc/6qoeuGedjOY/s200-c/free-victorian-purse-pattern-1.jpg"><br>Free Victorian Purse Pattern</a><a href="http://costumingdiary.blogspot.com/2012/12/natural-form-victorian-overskirt.html"><img alt="Natural Form Victorian Overskirt" src="https://lh3.googleusercontent.com/-ZrTDaXEOiiU/US__mPzz3dI/AAAAAAAADWQ/eBm3tO3P8oI/s200-c/IMG_5482%255B6%255D.jpg"><br>Natural Form Victorian Overskirt</a><a href="http://costumingdiary.blogspot.com/2012/11/truly-victorian-tv221-1878-tie-back.html"><img alt="Truly Victorian TV221 1878 Underskirt Pattern Review" src="https://lh4.googleusercontent.com/-GmrRTxJ5NGY/UKfO_SQzymI/AAAAAAAAAHA/A9qx6czpyJk/s200-c/Truly-Victorian-TV221-1878-Tie-Back-%255B1%255D%255B4%255D.png"><br>Truly Victorian TV221 1878 Underskirt Pattern Review</a><a href="http://costumingdiary.blogspot.com/2012/10/truly-victorian-tv121-petticoat-pattern.html"><img alt="Truly Victorian TV121 Petticoat Pattern Review" src="http://lh4.ggpht.com/-qTsclIxCTKY/UH7fK3jqKII/AAAAAAAAodI/2GaQOVrGuuA/s200-c/Truly%252520Victorian%252520TV121%2525201879%252520Petticoat%252520with%252520Detachable%252520Train%25255B6%25255D.png?imgmax=800"><br>Truly Victorian TV121 Petticoat Pattern Review</a>..ad naseum..</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.gallerypagetabs a,.gallerypagetabs p{
float:left;
font-size:.80em;
height:250px;
padding:10px;
text-align: center;
width:200px
}
Run Code Online (Sandbox Code Playgroud)
我想做的是当有人在图像上盘旋时,显示带有星星的透明图像.因此,如果一个人在自由维多利亚钱包图案图像上盘旋,他们会看到一个图像 - 比方说 - 五颗星表示该图案已经获得了我中5星中的5星评级.
我试过以下两个都没有运气.代码显示悬停时的图像,但它显示在图像的底部而不是重叠它:
.gallerypagetabs a:hover{
background-image:url('http://i.imgur.com/IKAXZKz.png');
background-position:inherit
}
Run Code Online (Sandbox Code Playgroud)
和
.gallerypagetabs a:hover{
background-image:url('http://i.imgur.com/IKAXZKz.png'); …Run Code Online (Sandbox Code Playgroud) 我正在Google Chrome上进行测试 32.0.1700.76 m
select标记中的最后一个选项是没有从鼠标获得悬停效果.
通过键盘使用时突出显示.

这样有一个SVG元素 -
<path d="M0,5.26429605180997L6.078685485212741,-5.26429605180997 -6.078685485212741,-5.26429605180997Z" transform="translate(100,100)scale(0.8)" style="fill: rgb(0, 0, 0);"></path>
Run Code Online (Sandbox Code Playgroud)
现在,这个元素非常小,在它上面盘旋非常困难.
如何增加悬停区域(保持此元素的区域相同),以便即使鼠标指向大约2 px,hover事件也会被触发?
更新10/3/2018:这不是R独有的.它之前已被报道,目前被标记为功能请求,在这里:https://github.com/plotly/plotly.js/issues/260
我正在为r中的plotly图形添加散点图点的自定义悬停文本.它似乎是将文本左对齐,居中对齐或右对齐,具体取决于文本框是分别显示在绘图点的右侧,中间还是左侧.无论盒子的位置如何,我都希望文本始终对齐.我已经能够设置字体样式,例如设置颜色和大小,但无法更改文本对齐方式.
这是一个MRE.我删除了传说,所以最右边的点被迫让他们的悬停框出现在点的左边.
plot_ly(iris,
x = ~Sepal.Length,
y = ~Sepal.Width,
type = 'scatter',
mode = 'markers',
hoverinfo = 'text',
hoverlabel = list(font = list(color = 'white')),
text = ~paste0('Some rather long text',
'\nSepal.Length: ', Sepal.Length,
'\nSepal.Width: ', Sepal.Width)) %>%
layout(showlegend = FALSE)
Run Code Online (Sandbox Code Playgroud)