using a value from where the mouse pointer is

using a value from where the mouse pointer is

hi,

i have more rows with different users and i want to get the user id from where the mouse pointer is and land it in the image source of mini_profile div
this stupid code of mine looks like this
php file
  1. echo "<span class='hover'>".$row1['name']."<span class='id_user' style='transparency:1%;'>".$row1['id_user']."</span></span>";
  2. echo "<span class='hover'>".$row2['name']."<span class='id_user' style='transparency:1%;'>".$row2['id_user']."</span></span>";
  3. <div id="mini_profile" style="display:none;position:absolute"><img src="/img/u<?php echo $row 1 or 2 depending where the mouse cursor is ['id_user'] ?>.png" ></div>
js file
  1. $(function(){
  2. $(document).mousemove( function(e) {
  3. mouseX = e.pageX; 
  4. mouseY = e.pageY;
  5. });
  6. $(".hover").hover(function(){
  7. //$("#mini_profile").text($(this).text());
  8. $("#mini_profile").css({'top':mouseY,'left':mouseX}).show();
  9. },
  10. function(){
  11. $("#mini_profile").fadeOut(500);
  12. });
  13. });
so any ideas how to make this more logical, because i think it is very twisted

thank you,
Dan.