#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    103
    Rep Power
    5

    Why isnt my onmouseover image changer not working


    when u mouse over the content the picture is supposed to change, but it doesnt
    heres the js
    Code:
    function menuimage(food)
    {
    document.getElementById('menuimage').src=food+".jpg";
    }
    window.onload = function () 
    {
        document.onmousemove = function (e) {
            e = e || window.event,mse=Mse(e);
            var img = document.getElementById('menuimage');
            img.style.left = mse[0]+17+"px";
            img.style.top = mse[1]+"px";
        }
    }
    function Mse(e)
    {
     if (window.event){
      var docs=[document.body.scrollLeft,document.body.scrollTop];
      if (!document.body.scrollTop)
      {
       docs=[document.documentElement.scrollLeft,document.documentElement.scrollTop];
      }
      return [e.clientX+docs[0],e.clientY+docs[1]];
     }
     return [e.pageX,e.pageY];
    }
    and heres the link
    http://mw3dailymedia.com/ckbargrill/
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    103
    Rep Power
    5
    found a solution, tanks!
  4. #3
  5. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4303
    Congratulations on finding a solution. Would you mind posting your solution? I'd appreciate it if you posted the solution you found, because people looking for answers find threads here via web searches.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo