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 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Help, i have tryed...but im not THAT good

    ok here the code (please read to bottom before u do anything)

    ------------------------code-----------------------

    <style>
    <!--
    .hide { position:absolute; visibility:hidden; }
    .show { position:absolute; visibility:visible; }
    -->
    </style>

    <SCRIPT LANGUAGE="JavaScript">

    var duration=3 // Specify duration of progress bar in seconds
    var _progressWidth = 50; // Display width of progress bar

    var _progressBar = new String(" ");
    var _progressEnd = 10;
    var _progressAt = 0;


    // Create and display the progress dialog.
    // end: The number of steps to completion
    function ProgressCreate(end) {
    // Initialize state variables
    _progressEnd = end;
    _progressAt = 0;

    // Move layer to center of window to show
    if (document.all) { // Internet Explorer
    progress.className = 'show';
    progress.style.left = (document.body.clientWidth/2) - (progress.offsetWidth/2);
    progress.style.top = document.body.scrollTop+(document.body.clientHeight/2) - (progress.offsetHeight/2);
    } else if (document.layers) { // Netscape
    document.progress.visibility = true;
    document.progress.left = (window.innerWidth/2) - 100;
    document.progress.top = pageYOffset+(window.innerHeight/2) - 40;
    } else if (document.getElementById) { // Netscape 6+
    document.getElementById("progress").className = 'show';
    document.getElementById("progress").style.left = (window.innerWidth/2)- 100;
    document.getElementById("progress").style.top = pageYOffset+(window.innerHeight/2) - 40;
    }

    ProgressUpdate(); // Initialize bar
    }

    // Hide the progress layer
    function ProgressDestroy() {
    // Move off screen to hide
    if (document.all) { // Internet Explorer
    progress.className = 'hide';
    } else if (document.layers) { // Netscape
    document.progress.visibility = false;
    } else if (document.getElementById) { // Netscape 6+
    document.getElementById("progress").className = 'hide';
    }
    }

    // Increment the progress dialog one step
    function ProgressStepIt() {
    _progressAt++;
    if(_progressAt > _progressEnd) _progressAt = _progressAt % _progressEnd;
    ProgressUpdate();
    }

    // Update the progress dialog with the current state
    function ProgressUpdate() {
    var n = (_progressWidth / _progressEnd) * _progressAt;
    if (document.all) { // Internet Explorer
    var bar = dialog.bar;
    } else if (document.layers) { // Netscape
    var bar = document.layers["progress"].document.forms["dialog"].bar;
    n = n * 0.55; // characters are larger
    } else if (document.getElementById){
    var bar=document.dialog.bar
    }
    var temp = _progressBar.substring(0, n);
    bar.value = temp;
    }

    // Demonstrate a use of the progress dialog.
    function Demo() {
    ProgressCreate(10);
    window.setTimeout("Click()", 100);
    }

    function Click() {
    if(_progressAt >= _progressEnd) {
    ProgressDestroy();
    return;
    }
    ProgressStepIt();
    window.setTimeout("Click()", (duration-1)*1000/10);
    }

    function CallJS(jsStr) { //v2.0
    return eval(jsStr)
    }

    </script>

    <SCRIPT LANGUAGE="JavaScript">

    // Create layer for progress dialog
    document.write("<span id=\"progress\" class=\"hide\">");
    document.write("<FORM name=dialog>");
    document.write("<TABLE border=2 bgcolor=\"#FFFFCC\">");
    document.write("<TR><TD ALIGN=\"center\">");
    document.write("Progress<BR>");
    document.write("<input type=text name=\"bar\" size=\"" + _progressWidth/2 + "\"");
    if(document.all||document.getElementById) // Microsoft, NS6
    document.write(" bar.style=\"color:navy;\">");
    else // Netscape
    document.write(">");
    document.write("</TD></TR>");
    document.write("</TABLE>");
    document.write("</FORM>");
    document.write("</span>");
    ProgressDestroy(); // Hides

    </script>


    <form name="form1" method="post">
    <center>
    <input type="button" name="Demo" value="Display progress" onClick="CallJS('Demo()')">
    </center>
    </form>

    ------------------------code-----------------------

    ok now that will make a popup progress bar. now i have made it so that it
    says there and there is nothing in it. but what i want to know is if u can
    make it so it will apear blank...then u can type something into it and it will
    apear in like a text box, or something, so i could use it for a log in or just for fun? any of u java people know how to do this??

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,529
    Thanks
    3
    Thanked 511 Times in 498 Posts
    seems a stange progress bar but with any object

    the easiest way would be, that on click remove it and replace with a text box in the same position.

    or on click activate kepress detection and insert the charactors in the progress bar object.

    The techniques are available but cant see much call for this type of gimic though

  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok....could u help do that??!?!?!?!?!?!?


  •  

    Posting Permissions

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