我对JQuery比较陌生,我希望能够在mouseover上显示一个菜单.
这是html
<td class ="comment_div"> <?php echo("$comment_data['comment']); ?> <br/>
<span class="comment_actions"> Approve | Delete | Spam | Edit</span>
</td>
Run Code Online (Sandbox Code Playgroud)
然后是JQuery
$("comment_div").hover(
function() { $(".comment_actions").show(); },
function() { $(".comment_actions").hide(); }
);
Run Code Online (Sandbox Code Playgroud)
这项工作是因为我将多个评论拉出来,这只会显示第一个div上的菜单,无论"评论"是什么.我想仅针对当前悬停的评论显示菜单.我想我需要使用"$ this"来完成这项工作但不确定如何.
谢谢.
我希望能够在以下场景中检测鼠标是否仍然在元素上:
我怎样才能达到#2?
谢谢.
使用以下html,当我将鼠标悬停在子项上时,我获得了父项的绿色背景.我怎么能阻止这种情况发生?如果我在子元素之外盘旋,我确实想要绿色背景.
CSS3很好.
.parent {
padding: 100px;
width: 400px;
height: 400px;
}
.parent:hover {
background-color: green;
}
.child {
padding: 100px;
width: 200px;
height: 200px;
}
.child:hover {
background-color: blue;
}Run Code Online (Sandbox Code Playgroud) 使用selenium-rc和java客户端,我想测试一个菜单,当用户将鼠标移到它上面时,该菜单会打开.当鼠标离开菜单时它会关闭.这是使用:hovercss 完成的,没有任何javascript.
在selenium中,有许多鼠标操作方法,但它们似乎都没有触发任何css :hover样式.
谷歌表明我并不是唯一一个解决这个问题的人,但是没有一个解决方案.有些人评论说你必须添加一些javascript代码; 但是,在selenium rc中,我认为我甚至没有一个适当的位置来提供用户贡献的额外javascript代码.
我希望下面的代码可以工作,因为div#navi_settings包含的菜单包含 - 通常是不可见的 - 元素:
selenium.mouseHover("css=div#navi_settings");
assertTrue(selenium.isVisible("//a[contains(text(), 'Text on link')]"));
Run Code Online (Sandbox Code Playgroud)
不幸的是,该方法moveHover()尚不存在.
情况:得到按钮图像的div.Div需要在悬停时淡出.适用于所有浏览器,Internet Explorer除外.当我给div一个背景颜色它突然起作用.
检查:http://ListAndPlay.com,左上角是控件.
悬停在IE中不起作用,尝试向#buttons添加背景颜色,它突然起作用.
问题:这是什么原因?如何正确解决这个问题?
我有一个我想实现的身体系统功能.当用户将鼠标悬停在身体部位上时,它会突出显示该特定身体部位的信息.我已经按照我想要的方式对CSS进行了编码,但是当我点击正文部分或鼠标离开悬停状态时,我对JavaScript没有任何了解.
我搜索了论坛,发现了类似的问题,花了好几个小时试图从别人的javascript解决方案中解决这个问题 - 我正处于需要求助的地步.
这是我用我想要的效果制作的flash原型:
http://inwavemedia.com/temp/proto/Main.html
如果您想查看我现在拥有的内容,这是实时HTML:
http://inwavemedia.com/temp/excretory.html
这是我的代码:
<style type="text/css">
#bodysystem-excretory {
width: 618px;
height: 504px;
background: url(excretory.png) no-repeat;
margin: 10px auto; padding: 0;
position: relative;
border: 1px solid #999;
}
#bodysystem-excretory li {
margin: 0;
padding: 0;
list-style: none;
display: block;
position: absolute;
}
#bodysystem-excretory a {
display: block;
/* text-indent: -9999px;*/
text-decoration: none;
}
#esoph {
left: 85px;
top: 41px;
width: 46px;
height: 94px;
z-index: 10;
}
#lungs {
left: 76px;
top: 84px; …Run Code Online (Sandbox Code Playgroud) 我想在子节点悬停时突出显示图中父节点的链接和节点.我从纽约时报的"白宫之路"中汲取灵感:

var node = svg.selectAll(".node")
.data(graph.nodes)
.enter()
.append("g")
.attr("class", function(d) { return "node " + d.name + " " + d.location; })
.call(force.drag)
.on("mouseover", function(d) {
// if(isConnected(d, o)) {
d3.select(this).select("circle").style("stroke-width", 6);
var nodeNeighbors = graph.links.filter(function(link) {
return link.source.index === d.index || link.target.index === d.index;
})
.map(function(link) {
return link.source.index === d.index ? link.target.index : link.source.index;
});
svg.selectAll('circle').style('stroke', 'gray');
svg.selectAll('circle').filter(function(node) {
return nodeNeighbors.indexOf(node.index) > -1;
})
// }
.on("mouseover", function(d) {
// I …Run Code Online (Sandbox Code Playgroud) 我想问一下,当用户将鼠标悬停在图像边框上时,应该如何对图像边框应用不同颜色的光晕?比如说在这个JSFiddle文件中,我有一个绿拇指和一个红拇指.我希望每个图像边框根据图像的颜色或我指定的任何颜色发光.我该怎么做?
PS**例如,图像在JSFiddle中转换为base64.
这就是我在CSS中的做法
img{
width: 16px;
cursor: pointer;
padding: 10px;
}
img:hover{
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 5px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 5px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
Run Code Online (Sandbox Code Playgroud)
谢谢
如果您将过渡如下所示,CSS过渡属性可让您在悬停和悬停时设置动画:
#inner{
opacity:0;
transition:opacity 2000ms;
}
#outer:hover #inner{
opacity:1;
}
Run Code Online (Sandbox Code Playgroud)
但是,如果转换移至:hover状态,则仅在悬停时发生.
#inner{
opacity:0;
}
#outer:hover #inner{
opacity:1;
transition:opacity 2000ms;
}
Run Code Online (Sandbox Code Playgroud)
是否可以反过来,即仅在悬停时动画?
我有一个圆形div,它有一个圆形图像和一个标题在底部whith opacity: 0.5;悬停不透明度应该变为1.它在所有桌面浏览器和Firefox for iOS上都很好,但它在Safari和Chrome for iOS上都不起作用.
小提琴:https://jsfiddle.net/a10rLbnL/2/
HTML:
<div class="video_wrap update">
<div class="content">
<div class="img_wrap"><img src="https://i.ytimg.com/vi/0HDdjwpPM3Y/hqdefault.jpg"></div>
<div class="title_wrap"><div class="title">bang bang</div></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.video_wrap {
display: inline-block;
width: 30%;
padding-bottom: 30%;
margin: 0 1%;
position: relative;
vertical-align: top;
}
.content {
position: absolute;
height: 100%;
width: 100%;
}
.img_wrap {
height: 100%;
border-radius: 120px;
overflow: hidden;
}
.title_wrap {
line-height: 50px;
top: -50px;
height: 50px;
position: relative;
left: 0px;
background: #fff;
color: #f8008c;
font-size: 12px; …Run Code Online (Sandbox Code Playgroud) hover ×10
css ×7
html ×3
jquery ×3
css3 ×2
class ×1
d3.js ×1
events ×1
force-layout ×1
highlight ×1
ios ×1
javascript ×1
mouseevent ×1
mouseover ×1
onclick ×1
parent ×1
selenium ×1
selenium-rc ×1
testing ×1
transparent ×1