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 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Editing Status bar when mouseover link

    like the title says, how do you edit what the status bar says when the crusor is over a link (basicaly like hiding the destination of the link - kinda ;D)

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Why would you do this? Hiding the url from the user isn't a good idea. Besides it won't work in Opera and Firefox allows users to not allow it.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <span style="cursor: hand" onclick="location.href=http://thedragonsden.us.to'" onmouseover="window.status='theDragonsDen'" onmouseout="window.status=''">Click Here to Visit theDragon'sDen</span>

  • #4
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by theDragonsDen View Post
    Code:
    <span style="cursor: hand" onclick="location.href=http://thedragonsden.us.to'" onmouseover="window.status='theDragonsDen'" onmouseout="window.status=''">Click Here to Visit theDragon'sDen</span>
    i tried this and it does show the edited statusbar but, when i click on the text, nothing happens

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,640
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Most browsers have the option to allow Javascript to update the status bar turned off. You can only update the status bar from Javascript where the person visiting your site has specifically turned on that option in their browser. They are u8nlikely to do that as that opens a number of security holes that can potentially result in their computer hard drive being trashed.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Besides it won't work in Opera […].
    Works fine for me in Opera 9.01. Of course, I may have tampered with the defaults and not remember having done so.

    Quote Originally Posted by KyuubiKahiera View Post
    i tried this and it does show the edited statusbar but, when i click on the text, nothing happens
    That's because the Javascript is missing an apostrophe within the onclick attribute's value. It's also using an incorrect, proprietary value for the cursor property; hand should be pointer. Here's a corrected version of theDragonsDen's code:

    Code:
    CSS:
    span {
      cursor: pointer;
      color: red;
      text-decoration: underline;
      }
    
    HTML and inline JavaScript/:
    <span onclick="location.href='http://thedragonsden.us.to/';"
          onmouseover="window.status='theDragon\u0027sDen';"
          onmouseout="window.status='';">Click Here to Visit theDragon'sDen</span>
    Of course, I would advise using an anchor (a) element instead of a span element for the link so that you have a fall-back in case the user has JavaScript disabled:

    Code:
    <a href="http://thedragonsden.us.to/"
       onmouseover="window.status='theDragon\u0027sDen';"
       onmouseout="window.status='';">Click Here to Visit theDragon'sDen</a>
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #7
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arbitrator View Post
    Code:
    CSS:
    span {
      cursor: pointer;
      color: red;
      text-decoration: underline;
      }
    
    HTML and inline JavaScript/:
    <span onclick="location.href='http://thedragonsden.us.to/';"
          onmouseover="window.status='theDragon\u0027sDen';"
          onmouseout="window.status='';">Click Here to Visit theDragon'sDen</span>
    this shows what i want done but i just need the text to be underlined and blue (which i can do myself) but, it shows the wrong crusor image i want. how can it be the pointer/finger crusor image?

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Just use the link code he gave you. It will get the finger cursor by default.
    ||||If you are getting paid to do a job, don't ask for help on 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
    •