...

View Full Version : Masking status bar text



deblaw223
01-21-2003, 08:51 AM
I'm brand new to javascript, but trying to learn. I found a script that completely masks from the browser's status bar the URL that would normally show as you mouse over a link on the webpage.

I would like to modify the script so that rather than mask the URL completely (which would tend to make the viewer even wonder if the link is a valid link), I would like to have the status bar of the browser display a static message (i.e."Website link" or anything).

Here's the script for complete masking.

<script>

//Hide status bar msg II script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus
</script>


Anybody suggest ways to modify it to do what I was thinking?

My first idea was to replace the window.status from " " to the message that I wanted. That displayed the message, but all the time rather than just when a mouse over a link occurred.

head8k
01-21-2003, 01:48 PM
How about:

<script>

//Hide status bar msg II script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

function hidestatus(){
window.status='Website Link'
return true
}

function resetstatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=resetstatus
</script>

Good luck

deblaw223
01-21-2003, 04:53 PM
I will give it a try, then try to understand it too! Thanks

deblaw223
01-21-2003, 05:37 PM
Tried the suggested script. The status bar displays "Website Link" all the time and not just upon mousing over a link. It never goes back to a blank status bar.

Any other ideas? Thanks a lot

Stoffel
01-21-2003, 05:43 PM
Just a stupid question

function resetstatus(){
window.status=''
return true
}


Did u write window.status=' '

justame
01-21-2003, 05:47 PM
deb...
/me just a does® it this way in the <a href tag...

onmouseover="window.status='What you want it to say'; return true;" onmouseout="window.status=''; return true;"

just a goodluck® n' hoping it helps...:O)))

deblaw223
01-21-2003, 05:52 PM
Stoeffel, it looks like an "=" here, but I checked the script and it is an apostrophe followed by another apostrophe

beetle
01-21-2003, 05:59 PM
Well, it's because you are using

document.onmouseover

to trigger the function. ANYthing inside the browser's viewport is the document.
function hidestatus( e )
{
var elem = ( document.all ) ? event.srcElement : e.target;
if ( elem.nodeType == 3 ) elem = elem.parentNode;
if ( elem.nodeName != "A" ) return true;;
window.status='Website Link'
return true;
}

function resetstatus( e )
{
var elem = ( document.all ) ? event.srcElement : e.target;
if ( elem.nodeType == 3 ) elem = elem.parentNode;
if ( elem.nodeName != "A" ) return true;
window.status='';
return true;
} There's other ways to do this, you could even have a separate status message per link.

Vladdy
01-21-2003, 06:12 PM
What's the point of hiding the URL in the first place:confused: :rolleyes: :confused:

deblaw223
01-21-2003, 06:18 PM
Thanks justame. It worked!

Vladdy--I wanted to modify the url of linked to pages not for any sinister reasons! :)

I have some free webspace with my cable internet service provider. So, rather than going with a webhost, I just registered a domain name, have a page parked with the registrar, with URL forwarding to the actual URL of my free webspace. So, a visitor that types the domain name, doesn't see the long complicated url of my free webspace but rather sees just my nice little domain name.

But, when a user mouses over a link on my page, the free webspace long url shows in the status bar of the browser. To make things look a little more professional, I read about changing the status bar message being capable of modification. So, there you have it!

Vladdy
01-21-2003, 06:33 PM
The long domain name will still be in the address bar.... Could be even more confusing....

deblaw223
01-21-2003, 06:35 PM
That is why I have URL masking from the registrar. It makes the url in the address bar show a constant name equal to the domain name.

justame
01-21-2003, 11:54 PM
deb...
youre more than just a welcome® :O)))

justame
01-21-2003, 11:56 PM
Originally posted by Vladdy
The long domain name will still be in the address bar....

vla...
nottt just a necessarily® :O)))...aka frames...

Vladdy
01-22-2003, 01:01 AM
Originally posted by justame
aka frames...
Oops, forgot some still use this atrocity :rolleyes: :D :D :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum