![]() HTML_Progress2 : The Definitive Guide
|
Changes value of the progress meter to the next value or next step.
These new methods were introduced with the new multiple label system, and should replaced
incValue()
deprecated.
![]() |
Note |
---|---|
incValue() method is almost equivalent to
moveStep() except that it did not provide display refresh.
|
Here is sample of your script version with HTML_Progress 1.x :
<?php require_once 'HTML/Progress.php'; $pb = new HTML_Progress(); $pb->setAnimSpeed(100); ?> <html> <head> <style type="text/css"> <!-- <?php echo $pb->getStyle(); ?> // --> </style> <script type="text/javascript"> <!-- <?php echo $pb->getScript(); ?> //--> </script> </head> <body> <?php echo $pb->toHtml(); do { $pb->display(); // <--- to remove !!! if ($pb->getPercentComplete() == 1) { break; } $pb->sleep(); // your long process goes here ! $pb->incValue(); // <--- to replace !!! } while(1); ?> </body> </html>
And your script version with HTML_Progress2 :
<?php require_once 'HTML/Progress2.php'; $pb = new HTML_Progress2(); $pb->setAnimSpeed(100); ?> <html> <head> <?php echo $pb->getStyle(false); echo $pb->getScript(false); ?> </head> <body> <?php $pb->display(); do { if ($pb->getPercentComplete() == 1) { break; } $pb->sleep(); // your long process goes here ! $pb->moveNext(); } while(1); ?> </body> </html>
![]() |
Tip |
---|---|
Of course, if you used the
run() method instead of the loop, you have nothing to change.
|
HTML_Progress2 : The Definitive Guide | v 1.0.0 : September 23, 2005 |