The Little Guy Posted February 14, 2010 Share Posted February 14, 2010 I have an image, is there a way for me to detect if the mouse is hovering over that image? If it is do some javascript otherwise don't do that javascript. Quote Link to comment Share on other sites More sharing options...
trq Posted February 15, 2010 Share Posted February 15, 2010 All browsers support an onMouseover event. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted February 15, 2010 Author Share Posted February 15, 2010 but I don't want an event, is there another way to do it? Quote Link to comment Share on other sites More sharing options...
trq Posted February 15, 2010 Share Posted February 15, 2010 but I don't want an event Yes you do. You want an event that is triggered when the mouse is over an object. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted February 15, 2010 Author Share Posted February 15, 2010 I should state that their is an onclick, then it triggers one function then in that function it triggers another function which I want to do the check in. Page: http://www.nawdog.com/view.php?id=2 if you click on the koala and move your mouse to the logo, the border stays green around the image after the larger image is created (which I don't want). if you click and keep your mouse on the koala, and after the larger image appears and you move your mouse off the image, the border goes away. Quote Link to comment Share on other sites More sharing options...
Psycho Posted February 16, 2010 Share Posted February 16, 2010 Your description is a little confusing. But, I *think* what you are wanting is a way to determine if the mouse is over an image after a function is triggered after an onclick event. If so, you just need to create a global variable to store the state of the mouse over the image. Then, when the function is triggered you can check that variable. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.