Hack Forums
Help fixing progress bar and other small things? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141)
+---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50)
+---- Thread: Help fixing progress bar and other small things? (/showthread.php?tid=5545752)



Help fixing progress bar and other small things? - orochimaruhf - Feb 7, 2017

Okay so here's my website: http://clashroyale-gem.com/test2
When you enter a random username and click generate, a progress bar shows up, however it does not work and it's stuck in one spot. Hope someone can help.

If you're not sure about fixing this, try helping me with some stuff on this link
http://clashroyale-gem.com (Main page)
Okay so put a random username and keep clicking generate blah blah, eventually this fake process thing shows up. There are 2 problems with it that I am hoping to fix:

a) The text takes really long, how do i make the letter typing speed faster?
b) When the user goes to another tab, the process stops. How do i turn that off?
ALSO: The website looks pretty ugly i know haha, i tried making the background the blue checkers and idk what happened.

Hope i can get some help, thanks!


* - Rushax - Feb 7, 2017

For the progress bar you want to put some jQuery event to say increase the width of the element:
#myBar by 1% every X seconds.

Code
$(function() {
    var pGress = setInterval(function() {
        var pVal = $('#myProgress').progressbar('option', 'value');
        var pCnt = !isNaN(pVal) ? (pVal + 1) : 1;
        if (pCnt > 100) {
            clearInterval(pGress);
        } else {
            $('#myBar').progressbar({value: pCnt});
        }
    },10);
});
Put this in your .js file & make sure the script is being brought in after jQuery.


* - Nerdi - Feb 8, 2017

(Feb 7, 2017 07:51 PM)Rushax Wrote:  For the progress bar you want to put some jQuery event to say increase the width of the element:
#myBar by 1% every X seconds.

Code
$(function() {
    var pGress = setInterval(function() {
        var pVal = $('#myProgress').progressbar('option', 'value');
        var pCnt = !isNaN(pVal) ? (pVal + 1) : 1;
        if (pCnt > 100) {
            clearInterval(pGress);
        } else {
            $('#myBar').progressbar({value: pCnt});
        }
    },10);
});
Put this in your .js file & make sure the script is being brought in after jQuery.

Well, that's called a "fake progress bar" because it changes even if no progress is made. For example, if his script gets stuck on something or takes a while the progress bar could show 100% even if the script isn't done.


* - orochimaruhf - Feb 8, 2017

(Feb 8, 2017 02:25 PM)Nerdi Wrote:  Well, that's called a "fake progress bar" because it changes even if no progress is made. For example, if his script gets stuck on something or takes a while the progress bar could show 100% even if the script isn't done.

Yeah, what i'm tryna do is a fake progress bar, however once it gets to 100 i want it to do something.


* - Rushax - Feb 8, 2017

(Feb 8, 2017 02:25 PM)Nerdi Wrote:  Well, that's called a "fake progress bar" because it changes even if no progress is made. For example, if his script gets stuck on something or takes a while the progress bar could show 100% even if the script isn't done.

I know its a fake progress bar, its a CPA for a game. He just wants to make it seem as though it's legit to users, that's why I offered the solution.

Then you could add an event once the width is equal to 100%.