Examples TOCexamples

NoString

$Date: 2005/07/25 10:25:30 $

 Table of contents

Introduction

This example requires :


This example will run a basic horizontal ProgressBar, but without percent text info.

There are 10 cells with default values:

Percent text info is hidden (see lines 16 and 17).

[Top]

 Render options

None. Used all default values.

[Top]

 Output

Screenshot

[Top]

 PHP source syntax highlight

  1. <?php
  2. /**
  3.  * Horizontal no String ProgressBar example.
  4.  *
  5.  * @version    $Id: nostring.php,v 1.2 2005/07/25 10:25:30 farell Exp $
  6.  * @author     Laurent Laville <pear@laurent-laville.org>
  7.  * @package    HTML_Progress
  8.  * @subpackage Examples
  9.  */
  10.  
  11. require_once 'HTML/Progress.php';
  12.  
  13. $bar = new HTML_Progress();
  14. $bar->setAnimSpeed(100);
  15. $bar->setIncrement(10);
  16. $bar->setStringPainted(true);   // get space for the string
  17. $bar->setString('');            // but don't paint it
  18. ?>
  19. <html>
  20. <head>
  21. <title>Horizontal no String ProgressBar example</title>
  22. <style type="text/css">
  23. <!--
  24. <?php echo $bar->getStyle(); ?>
  25.  
  26. body {
  27.     background-color: #FFFFFF;
  28.     color: #000000;
  29.     font-family: Verdana, Arial;
  30. }
  31.  
  32. a:visited, a:active, a:link {
  33.     color: navy;
  34. }
  35. // -->
  36. </style>
  37. <script type="text/javascript">
  38. <!--
  39. <?php echo $bar->getScript(); ?>
  40. //-->
  41. </script>
  42. </head>
  43. <body>
  44.  
  45. <?php
  46. echo $bar->toHtml();
  47. $bar->run();
  48. ?>
  49.  
  50. </body>
  51. </html>

[Top]