Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Masking status bar text

    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.

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    As easy as 3.1415926535897932384626433832795028841

  • #3
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I will give it a try, then try to understand it too! Thanks

  • #4
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    New Coder
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just a stupid question

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


    Did u write window.status=' '
    SToFFeL

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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)))

  • #7
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Stoeffel, it looks like an "=" here, but I checked the script and it is an apostrophe followed by another apostrophe

  • #8
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, it's because you are using

    document.onmouseover

    to trigger the function. ANYthing inside the browser's viewport is the document.
    Code:
    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.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's the point of hiding the URL in the first place
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #10
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    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!

  • #11
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The long domain name will still be in the address bar.... Could be even more confusing....
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #12
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #13
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    deb...
    youre more than just a welcome® :O)))

  • #14
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Originally posted by Vladdy
    The long domain name will still be in the address bar....
    vla...
    nottt just a necessarily® :O)))...aka frames...

  • #15
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by justame
    aka frames...
    Oops, forgot some still use this atrocity
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •