Hide URL in statusbar when mouse over link

T

Targa

I know you can do an onmouseover/onmouseout to display alternate text for
links but Im looking for a script that would cover all links on a page
without having to add code to each link.

Is there such a thing?

I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to view
the links.

TIA!
 
M

McKirahan

Targa said:
I know you can do an onmouseover/onmouseout to display alternate text for
links but Im looking for a script that would cover all links on a page
without having to add code to each link.

Is there such a thing?

I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to view
the links.

TIA!

Is this what you want?

<style type="text/css">
a { text-decoration:none }
</style>
 
T

Targa

Thanks but no - that would just keep links from being underlined.

I need to keep the URL of all links from showing up in the statusbar.
 
M

McKirahan

Targa said:
Thanks but no - that would just keep links from being underlined.

I need to keep the URL of all links from showing up in the statusbar.


Your original post didn't mention the statusbar.

Will one of these work for you?

<html>
<head>
<title>hrefhide.htm</title>
<script type="text/javascript">
function a() {
location.href = "http://www.google.com/";
}
</script>
</head>
<body>
<a href="javascript:a()">Google</a>
<br><br>
<a href="#" onclick="location.href='http://www.google.com/'">Google</a>
<br><br>
<a onclick="location.href='http://www.google.com/'"
style="cursor:hand"><u>Google</u></a>
<br><br>
<a onclick="location.href='http://www.google.com/'"
style="cursor:pointer"><u>Google</u></a>
</body>
</html>
 
M

Martin Honnen

Targa said:
Im looking for a script that would cover all links on a page
without having to add code to each link.
I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to view
the links.

Tested with IE 6:

<html lang="en">
<head>
<title>mouseover handler</title>
<script type="text/javascript">
function mouseOutHandler (evt) {
if (typeof evt != 'undefined') {
evt = window.event;
}
window.status = '';
if (evt && typeof evt.returnValue != 'undefined') {
evt.returnValue = true;
}
if (evt && evt.preventDefault) {
evt.preventDefault();
}
return true;
}

window.onload = function (evt) {
if (document.addEventListener) {
document.addEventListener(
'mouseover',
mouseOutHandler,
false
);
}
else if (document.attachEvent) {
document.attachEvent(
'onmouseover',
mouseOutHandler
);
}
};
</script>
</head>
<body>
<p>
Does the status bar show the link URL?
<a href="http://www.example.com/">example</a>
</p>
</body>
</html>

Should work with IE 5.5 too.
 
T

Targa

Thanks again for the reply.

Hide URL in Statusbar... is the subject of this thread.

The code provided requires modification to each link which wont work for me.
I need a single script that would hide all urls on the page.
 
T

Targa

Thanks Martin - Works great!


Martin Honnen said:
Tested with IE 6:

<html lang="en">
<head>
<title>mouseover handler</title>
<script type="text/javascript">
function mouseOutHandler (evt) {
if (typeof evt != 'undefined') {
evt = window.event;
}
window.status = '';
if (evt && typeof evt.returnValue != 'undefined') {
evt.returnValue = true;
}
if (evt && evt.preventDefault) {
evt.preventDefault();
}
return true;
}

window.onload = function (evt) {
if (document.addEventListener) {
document.addEventListener(
'mouseover',
mouseOutHandler,
false
);
}
else if (document.attachEvent) {
document.attachEvent(
'onmouseover',
mouseOutHandler
);
}
};
</script>
</head>
<body>
<p>
Does the status bar show the link URL?
<a href="http://www.example.com/">example</a>
</p>
</body>
</html>

Should work with IE 5.5 too.
 
G

Grant Wagner

Martin Honnen said:
Tested with IE 6:

Should work with IE 5.5 too.

Below works in Netscape 4, IE 4+, Opera 6+ and Mozilla:

function setAllHrefMOut(f, d, inLayer) {
if (!inLayer) {
d = document;
}

if (d) {

var i;

if (d.links) {
i = d.links.length;
while (i-- > 0) {
if (!d.links.onmouseout) {
d.links.onmouseout = f;
}
}
}

if (d.layers) {
i = d.layers.length;
while (i-- > 0) {
setAllHrefMOut(f, d.layers.document, true);
}
}
}
} // setAllHrefMOut()

Corresponding setAllHrefMOver() could be written as well, or modify the
current function to specify mouseover/mouseout.

Called using:

function myMouseOut() {
// do whatever
return true;
}
setAllHrefMOut(myMouseOut);

Yes, yes, I realized later that I didn't really need to pass "inLayer",
but I was concerned someone would see the method signature and do:

setAllHrefMOut(myMouseOut, document);
 
R

Randell D.

Hi,

I think this is what you are looking for:

Place the following inside the <HEAD> tags...

<script language="JavaScript" type="text/javascript">
function updateStatusBar()
{
window.status = " ";
timerID= setTimeout("updateStatusBar()", 250);

}
</script>

And call the function either with an onload in the BODY tag, or call it
using a seperate javascript call at the very end of your html... thus

..
..
..
..
<script language="JavaScript" type="text/javascript">
updateStatusBar();
</script>
</BODY>
</HTML>

The above loops every 250ms calling the function updateStatusBar which
sets the status bar to a space... Perhaps 250ms is too small - looping
that fast might consume too much CPU on slower machines - don't know -
you'll have to test it.

I hope it helps
randell d.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top