別の要素の上にマウスを置くと、1つの要素に変更display: none
されるはずのコードがここにあります。display: block
HTML:
<li onmouseover="popup('Ipsum');">Lorem</li>
Javascript:
$(document).ready(function(){
$("body").append('<div id="pup"></div>'); // Appends a popup div to the page
$(document).mousemove(function(e){
var x,y; // This sets the mouse
// coordinates into 2
x = $(document).scrollLeft() + e.clientX; // variables in order to
y = $(document).scrollTop() + e.clientY; // display the tooltip
}); // relative to mouse postition
function popup(text)
{
$('#pup').html(text); // This is supposed to enter text into the tooltip
$('#pup').show(); // div and change it from display: none to
// display: block
}
現在、divは存在します(ただしdisplay: none
、CSSでに設定されているため表示されませんが、liの上にマウスを置くと表示されません。ありがとうございます。