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 10 of 10

Thread: Status Bar Text

  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Status Bar Text

    As much as I hate to use it, the design I am currently working on calls for one of those annoying marquees within the status bar. I'm understandably reluctant to use it, as I hate obscuring the link destinations and loading progress, and am trying to find a way to be able to enable the user to switch the status bar marquee on and off whenever they want, without having to refresh the page. At the moment, it isn't going well. I can include a code and a button to enable the user to start the status bar scroll:

    Code:
    <body>
    <head>
    <script language="JavaScript"> 
    <!--
    var count = 0; 
    var delay = 250; 
    var text = "This is what I am replacing the default status bar text with";
    function  scroll () {
           window.status = text.substring (count, text.length) + text.substring (0, count)
            if (count < text.length)
                    count ++;
            else
                    count = 0;
            setTimeout ("scroll()", delay);
    }
    -->
    </script>
    </head>
    <form>
    <input type="button" value="click here" onClick="scroll();">
    </form>
    </body>
    Obviously, this doesn't enable the user to turn off the feature when he/she pleases; not only that, but (for some reason; my knowledge of Javascript doesn't cover enough for me to be able to come up with an explanation for this) the more the button is clicked, the faster the scroll becomes. I tried to include a button that set the window.status to window.statusDefault, but all that does is flash "undefined" in the status bar for a fraction of a second and carry on with the original script. Without the user refreshing the page, how can I include a code to stop the first code from executing?

    I hope I've made the problem clear...

  • #2
    New Coder
    Join Date
    May 2005
    Posts
    78
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Schannah View Post
    As much as I hate to use it, the design I am currently working on calls for one of those annoying marquees within the status bar. I'm understandably reluctant to use it, as I hate obscuring the link destinations and loading progress, and am trying to find a way to be able to enable the user to switch the status bar marquee on and off whenever they want, without having to refresh the page. At the moment, it isn't going well. I can include a code and a button to enable the user to start the status bar scroll:

    Code:
    <body>
    <head>
    <script language="JavaScript"> 
    <!--
    var count = 0; 
    var delay = 250; 
    var text = "This is what I am replacing the default status bar text with";
    function  scroll () {
           window.status = text.substring (count, text.length) + text.substring (0, count)
            if (count < text.length)
                    count ++;
            else
                    count = 0;
            setTimeout ("scroll()", delay);
    }
    -->
    </script>
    </head>
    <form>
    <input type="button" value="click here" onClick="scroll();">
    </form>
    </body>
    Obviously, this doesn't enable the user to turn off the feature when he/she pleases; not only that, but (for some reason; my knowledge of Javascript doesn't cover enough for me to be able to come up with an explanation for this) the more the button is clicked, the faster the scroll becomes. I tried to include a button that set the window.status to window.statusDefault, but all that does is flash "undefined" in the status bar for a fraction of a second and carry on with the original script. Without the user refreshing the page, how can I include a code to stop the first code from executing?

    I hope I've made the problem clear...
    Well, I'm not exactly great with JavaScript, but couldn't you just do this:

    originalstatus=window.status;

    before you start the marquee, and then incorporate some sort of check to see if you're running the marquee or you have it off, and to start the opposite function?

    So basically have it do this:
    1) Store status BEFORE the marquee with "originalstatus=window.status"
    2) Check to see if marquee is on or off
    3) If marquee is on, turn it off, and if it is off, turn it on


    I know this is possible, and have seen it before on this site. I don't know how to do it without looking it up. Plenty of people on this forum know how to do it, hopefully one of them will stop by and help you.

    By the way this belongs in the JavaScript section.

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Schannah ,

    Hope this will help you to solve your problem
    ----------------------

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript">
    <!--
    var count = 0;
    var delay = 250;
    var text = "This is what I am replacing the default status bar text with";
    var gStatus="hide"
    var gTime=0
    function scroll () {
    window.status = text.substring (count, text.length) + text.substring (0, count)
    if (count < text.length){
    count ++;
    }
    else{
    count = 0;
    }
    //gTime = setTimeout ("scroll()", delay);
    }
    function fHideStatus(lObj){
    lObj.outerHTML = '<input type="button" value="Show" onClick="fShowStatus(this);">'
    count = 0;
    window.status=""
    clearInterval(gTime)

    }
    function fShowStatus(lObj){
    gTime = setInterval("scroll()", delay);
    lObj.outerHTML = '<input type="button" value="Hide" onClick="fHideStatus(this);">'
    }
    -->
    </script>
    </head>
    <body>

    </head>
    <form>
    <p><input type="button" value="Show" onClick="fShowStatus(this);"></p>
    </form>
    </body>
    </html>

  • #4
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    Ack. Slight problem: code doesn't work in Firefox. To be honest, it doesn't really need to work in Firefox as Firefox allows a link destination to be displayed on hover with or without other text in the status bar present; what would probably be better would be Firefox displaying the status bar text upon loading the page, and there being no button to tell it to do otherwise.
    Last edited by Schannah; 02-26-2007 at 06:06 PM. Reason: New discovery

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,618
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Most modern browsers don't allow the web page to access the status bar for security reasons. The status bar displays information about the links on your page which phishing attempts wish to have concealed or replaced in order to make you think you're going to your bank's web site but instead you go to theirs where you enter your password and they empty your bank account.
    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
    New to the CF scene
    Join Date
    Mar 2005
    Location
    Toronto
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Firefox Status Bar

    You need to enable status bar writing in Firefox:

    http://jdev.blogsome.com/2006/08/18/...us-in-firefox/

  • #7
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,618
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Quote Originally Posted by eric6930 View Post
    You need to enable status bar writing in Firefox:

    http://jdev.blogsome.com/2006/08/18/...us-in-firefox/

    But only if you want the phishers to empty your bank account of all your money. It is turned off because having it on creates a big security hole for theives.
    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.

  • #8
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not entirely sure what you mean. I know that Firefox doesn't generally change the status bar text when stated in a script on the page unless you go through to the Firefox settings and change the allowances. That's not what I mean, though. In Firefox, the button doesn't change to "Hide" after it's been clicked; it remains on "Show" and furthermore, when it's clicked again, it increases the speed of the marquee scroll. Owing to the fact that not many Firefox users will have gone through their settings and allowed the status bar text to be changed, I think the best course of action would be to include a script that detects the browser and, in the case of Firefox, doesn't show the button at all, so that's what I've done.
    Last edited by Schannah; 02-27-2007 at 12:52 AM.

  • #9
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,618
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Most other browsers don't allow the status bar to be updated either unless you change the settings. It is only IE that is still behind with their security settings that allows it by default.
    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.

  • #10
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by Schannah View Post
    As much as I hate to use it, the design I am currently working on calls for one of those annoying marquees within the status bar. I'm understandably reluctant to use it, as I hate obscuring the link destinations and loading progress, and am trying to find a way to be able to enable the user to switch the status bar marquee on and off whenever they want, without having to refresh the page. At the moment, it isn't going well. I can include a code and a button to enable the user to start the status bar scroll:
    Someone asked for something similar recently. This script pauses when links are hovered (in the same frame) to allow the href to be shown, and it can be paused. Link


  •  

    Posting Permissions

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