<script>
    $(document).ready(function(){
    
   $("#img").mouseover(function(e){
            var widthh=e.originalEvent.x-$(this).offset().left||e.originalEvent.layerX-$(this).offset().left||0;//
            var heightt=e.originalEvent.y-$(this).offset().top||e.originalEvent.layerY-$(this).offset().top||0;//
            var tooltip = "<div id='tooltip'>图片的宽度:" + widthh +"<br>图片的高度:"+heightt+ "</div>";    
            $('#container').append(tooltip);
        }).mouseout(function(){
            $("#tooltip").remove();
            this.title = this.myTitle;
        })
   
  
    });
    </script>
以上是可以显示一次图片坐标的正确代码,但是我想是鼠标移动到图片哪里,就能马上显示,jquery怎么弄呢?