在Chromes Dev Tools中,您可以选择一个元素并启用悬停状态.有没有办法可以在Internet Explorers Dev Tools中完成?
我有以下HTML/CSS代码,用于根据从数据库中检索的行数显示页面.
.paginate {
font-family:Arial,Helvetica,sans-serif;
padding:3px;
margin:3px;
}
.disableCurrentPage {
font-weight:bold;
background-color:#999;color:#FFF;
border:1px solid #999;
text-decoration:none;color:#FFF;
font-weight:bold;
}
.paging {
cursor: pointer;
background-color: transparent;border:1px solid #999;
text-decoration:none;
color:#9CC;
font-weight:bold;
}Run Code Online (Sandbox Code Playgroud)
<div class='paginate'>
<input type="submit" name="btnFirst" value="First"
class="disableCurrentPage" disabled="disabled"/>
<input type="submit" name="btnPrev" value="Previous" class="paging"/>
<input type="submit" name="btnPage" value="1"
class="disableCurrentPage" disabled="disabled"/>
<input type="submit" name="btnPage" value="2" class="paging"/>
<input type="submit" name="btnPage" value="3" class="paging"/>
<input type="submit" name="btnPage" value="4" class="paging"/>
<input type="submit" name="btnPage" value="5" class="paging"/>
<input type="submit" name="btnPage" value="6" class="paging"/>
<input type="submit" name="btnPage" value="7" class="paging"/>
<input type="submit" …Run Code Online (Sandbox Code Playgroud)我有一个带有子div的div.当鼠标悬停在父div上时,我使用jQuery来显示/隐藏子div(父div跨越页面的整个底部.宽度:100%和高度100px).我已经使用了firebug和ie开发人员工具栏来确认父div在页面上.
我可以将鼠标悬停在Chrome和FireFox中的空父div上,一切正常.IE要求我有一些文本在里面悬停.div hover事件不会只用一个空div来触发.
所有合理的解决方案都适用于这个问题?
--update
尝试了所有的建议,但没有任何工作.
<div id="toolBar">
<div>
<button id="btnPin" title="Click to pin toolbar" type="button">
<img id="pin" src="../../images/icons/unpin.png" alt="Pin" /></button>
<img src="../../images/icons/search.png" border="0" alt="Search" />
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
上面的html包含在母版div容器中.使用jQuery隐藏子div并进行一些悬停/输出事件.父div(toolBar)始终在页面上可见.当工具栏上发生悬停时,会显示子div.
继承人jQuery代码
$('#toolBar').hover(ToolBar_OnHover, ToolBar_OnBlur);
function ToolBar_OnHover() {
$(this).children().fadeIn('fast');
$(this).animate({ height: "100px" }, "fast");
}
function ToolBar_OnBlur() {
$(this).children().fadeOut('fast');
$(this).animate({ height: "50px" }, "fast");
}
Run Code Online (Sandbox Code Playgroud)
最后这里有点css
#toolBar { width: 100%; height: 100px; text-align:center; vertical-align:middle; position: absolute; bottom: 0; background-color: Transparent; }
#toolBar div { padding: 5px 5px 0px 5px; width:75%; height: 95px; background: …Run Code Online (Sandbox Code Playgroud) 我用过硒2.31.
我已经使用Actions类进行鼠标移动.使用这个我将鼠标移到一个菜单上,它的子菜单只出现了一小段时间,与旧版本的firefox不同.
由于这个问题我无法选择子菜单,driver.findElement因为它抛出异常"元素无法滚动到视图中".
这有什么解决方案吗?
我正在使用html5 canvas元素绘制带有圆点的图形,表示此处的各个点.
我想在鼠标悬停的不同点上显示不同的工具提示.用户将提供要显示为工具提示的文本.
我尝试但无法弄清楚如何将图钉添加到图中的各个点.我用于显示点的代码是..
// Draw the dots
c.fillStyle = '#333';
for (var i = 0; i < data.values.length; i++) {
c.beginPath();
c.arc(getXPixel(data.values[i].X), getYPixel(data.values[i].Y), 4, 0, Math.PI * 2, true);
c.fill();
}
Run Code Online (Sandbox Code Playgroud)
我应该在此代码中添加什么,以便我能够将用户输入显示为工具提示?
将鼠标悬停在DIV上时是否可以显示内容.见图片
当我将鼠标悬停在div上时,会发生转换,但是可以在悬停div中显示内容,即.图像等
HTML:
<div class="flowingdown">
</div>
Run Code Online (Sandbox Code Playgroud)
CSS3:
.flowingdown {
width:1045px;
background-image:url(images/vertical_cloth.png);
height:50px;
float:left;
margin-top:2px;
margin-bottom:2px;
border-radius:0 0 55px 55px ;
transition: height 1s;
-webkit-transition: height 1s;
}
.flowingdown:hover {
height:100px;
}
Run Code Online (Sandbox Code Playgroud) stackoverflow如何对问题的标记进行悬停效果?如何使用jquery做同样的事情?
编辑:不是鼠标悬停我希望子菜单显示 Add Jquery to favorite tags
我有Form子类,带有处理程序MouseHover和MouseLeave.当指针位于窗口的背景上时,事件工作正常,但当指针移动到窗口内的控件上时,它会引发MouseLeave事件.
无论如何有一个覆盖整个窗口的事件.
(.NET 2.0,Visual Studio 2005,Windows XP.)
我在WPF中使用一个简单的按钮.我在背景上放了按钮的图像.我的问题是,当我将鼠标指针移动到按钮时,它会获得默认的光晕并覆盖作为背景给出的图像.
<Button Grid.Column="3" Name="Play" BorderBrush="Transparent"
Focusable="False" Width="45" Height="45" Click="Play_Click"
VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,6,10,6">
<Button.Background >
<ImageBrush ImageSource="images/play.png" />
</Button.Background>
<Button.Foreground>
<ImageBrush ImageSource="images/play.png" />
</Button.Foreground>
</Button>
Run Code Online (Sandbox Code Playgroud)
请帮我.
编辑:所以我想出了一种悬停在元素上的简单方法,但我想等待弹出一个结果.Chrome网页驱动程序悬停在元素上并且移动得太快,以至于我无法看到文本.在文本弹出之前,如何让它保持悬停状态?我查看了Wait()和until(),但我似乎无法使它们正常工作(我认为这是因为我并不是真的在等待代码中的布尔值.除非有人有一些建议吗? ).这就是我到目前为止所拥有的......
WebDriver driver = getWebDriver();
By by = By.xpath("//*[@pageid='" + menuItem + "']");
Actions action = new Actions(driver);
WebElement elem = driver.findElement(by);
action.moveToElement(elem);
action.perform();
Run Code Online (Sandbox Code Playgroud)
再次感谢大家!
干杯.
mousehover ×10
c# ×2
css ×2
hover ×2
html ×2
java ×2
jquery ×2
button ×1
css3 ×1
events ×1
html5-canvas ×1
javascript ×1
mouseleave ×1
mouseover ×1
selenium ×1
styles ×1
stylesheet ×1
tags ×1
tooltip ×1
winforms ×1
wpf ×1