这需要出现在这个 Fiddle 中图像下方的文本框:http://jsfiddle.net/ANKwQ/5/ 而是具有相同的效果:http://xurday.com ,当您将鼠标悬停在图像上时,这意味着它会随着光标在图像中移动。
div {
display: none;
border:1px solid #000;
height:30px;
width:290px;
margin-left:10px;
a:hover + div {
display: block;
最佳答案
在这里JSFiddle :
基本上所有你需要的:
var currentMousePos = { x: -1, y: -1 };
$(document).mousemove(function(event) {
currentMousePos.x = event.pageX;
currentMousePos.y = event.pageY;
$('div').css('top', currentMousePos.y);
$('div').css('left', currentMousePos.x);
});
CSS:
div {
display: none;
border:1px solid #000;
height:30px;
width:290px;
margin-left:10px;
position: absolute;
}
关于html - OnMouseOver 图像在光标上显示文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28315129/