Log in

View Full Version : mouse cursor moves over an image



amyy
11-22-2007, 02:39 AM
I use frames for my webpage.
When the mouse cursor moves over an image, the actual URL of that webpage appears.
May I know what code to use so that the actual URL of that webpage will not appear when the mouse cursor moves over an image?
Thank you.

djr33
11-22-2007, 08:20 AM
If you're trying to hide the URL from people, it's not hard to find. This won't be secure.

You can probably just override the window.status value with javascript.

There are a few other ways, such as using a javascript href, or # href with javascript onclick, but that would limit functionality to users with javascript enabled.

amyy
11-22-2007, 11:11 AM
Thanks a lot dir. Actually i did not specifically want to hide the URL.

jscheuer1
11-22-2007, 04:12 PM
What did you specifically want to do?

amyy
11-25-2007, 11:28 AM
I notice that for other sites, when the cursor moves over the image, the URL did not appear. I wonder how I could achieve that?

Many thanks in advance.

jscheuer1
11-25-2007, 02:25 PM
I notice that for other sites, when the cursor moves over the image, the URL did not appear. I wonder how I could achieve that?

Many thanks in advance.

I'm not really sure what you mean when you say:


When the mouse cursor moves over an image, the actual URL of that webpage appears.

That sounds to me as though you just need to add/remove/edit the title attribute of the image tag and/or set the alt attribute more appropriately. But you might be talking about a linked image, which could be different. Where does the URL appear? I'd also like to see an example to really know what you are talking about.

Please post a link to the page on your site that contains the problematic code so we can check it out.

Tell me what to do, and in what browser to do it, to see this URL, and where to look for it showing up.

Master_script_maker
11-25-2007, 09:07 PM
Use the alt attribute when you declare the picture.

<img src="url" alt="text to show when mouse hovers over" />
http://w3schools.com/html/html_images.asp

jscheuer1
11-25-2007, 09:37 PM
Use the alt attribute when you declare the picture.

<img src="url" alt="text to show when mouse hovers over" />
http://w3schools.com/html/html_images.asp

If it is a tool tip sort of thing that is happening, title or alt is already set to the URL that the original poster wants to avoid showing, yes. If so, it was probably set by their editor automatically. Using the alt attribute will only fix that in IE, and only if the title attribute isn't already involved. But, it could be other things.