Wie man einen Div an Cursor kleben lässt
Posted: 27 Feb 2025, 11:02
Ich habe ein Skript, das ein DIV auf dem Schwebedruck zeigt und es an den Cursor steckt. < /p>
Es funktioniert, aber irgendwie liegt zwischen dem klebrigen div und dem Cursor immer Platz. < /p>
Dies ist das CSS meines Divs: < /p>
#img-container .captioning .title {
width: auto;
height:auto;
position: absolute;
float:left;
z-index:1;
display: none;
}
< /code>
Stimmt etwas mit meinem JS nicht? Ich bin dankbar für jede Hilfe! http://jsfiddle.net/hj57k/
Code: Select all
$(".picture_holder_thumb").mouseover(function () {
$(".title", this).show();
});
$(".picture_holder_thumb").mouseout(function () {
$(".title", this).hide();
});
$(document).bind('mousemove', function (e) {
$(".title", this).css({
left: e.pageX,
top: e.pageY
});
});
Dies ist das CSS meines Divs: < /p>
#img-container .captioning .title {
width: auto;
height:auto;
position: absolute;
float:left;
z-index:1;
display: none;
}
< /code>
Stimmt etwas mit meinem JS nicht? Ich bin dankbar für jede Hilfe! http://jsfiddle.net/hj57k/