< ;meta charset="utf-8"/>
<script> <br>/*Text prompt*/ <br>/* <br> (1) When the mouse moves in, create a div whose content is the value of the title attribute <br> (2) Specify the position and set css style <br> (3) When the mouse moves out, remove the div <br> (4) When the mouse moves, the coordinates of the X and Y axes should change accordingly <br>*/ <br>$(function(){ <br>var x = 7; <br>var y = 8; <br>$("a.tip").hover(function(){ <br>var title = this.title; <br>var $div = $("<div id='newTip'>" title "</div>"); <br>$("body").append($div); <br>$div.css({" position":"absolute","background":"pink"}); <br>},function(){ <br>$("#newTip").remove(); <br>}).mousemove(function (e){ <br>var $div = $("#newTip").css({"left":(e.pageX x) 'px',"top":(e.pageY y) 'px'} ); <br>}); <br>}) <br></script>
This is my tip