www.webdeveloper.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2010
    Posts
    25

    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
    Join Date
    Mar 2010
    Posts
    25
    found a solution, tanks!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles