inzo21 Posted February 5, 2004 Posted February 5, 2004 Hi everyone, I'm having a problem I can't quite understand with a mouse over that I am trying to do in a user control. I want the image to change when the user hovers over it and back to the original on mouseout. Here is the code I am using. <IMG id="home" style="Z-INDEX: 101; LEFT: 1px; POSITION: absolute; TOP: 1px" alt="" src="file:///C:\Inetpub\wwwroot\testweb\images\home_off.gif" onmouseover="home.src='file:///C:\Inetpub\wwwroot\testweb\images\home_on.gif';" onmouseout="home.src='file:///C:\Inetpub\wwwroot\testweb\images\home_off.gif';"> this seems compliant with code I have verified from MSDN and the following article: http://www.wdvl.com/Authoring/ASP/NET_Nutshell/asp_net1_2.html the issue I have is that is gives me the typical "x" as an image after I hover over the image - as if it can't find the image. I am able to add both images directly onto the user control and can browse directly to the image if I put the url in the browser. any ideas? thanx again, inzo Quote he who forgets will be destined to remember... (E.Vedder)
Administrators PlausiblyDamp Posted February 5, 2004 Administrators Posted February 5, 2004 You will need to specify the image src as a URL rather than a file system path. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
inzo21 Posted February 5, 2004 Author Posted February 5, 2004 that did it! one other question... do you know a way that I can reference the image based on the root of the web site rather than hard-coding it? I tried ../testweb/images/home_off.gif to no avail. other than that, thank you so much for your feedback. have a great day inzo Quote he who forgets will be destined to remember... (E.Vedder)
inzo21 Posted February 5, 2004 Author Posted February 5, 2004 scratch that - I removed a period and it works. ./images/home_off.gif thanx again, inzo Quote he who forgets will be destined to remember... (E.Vedder)
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.