BullIt
Overview
This example will run a plain horizontal progress bar.
Screenshot
Demonstration
Give it a try
Dependencies
This example requires mandatory resources :
And also but optional :
Explains step by step
The progress meter wait 200ms (line 14)
between each step of 10% (line 15).
There are 10 cells 20x20 collapsed (lines 16-21):
Property | Value | Default |
active-color | #000084 | #006600 |
inactive-color | #3A6EA5 | #CCCCCC |
width | 20 | 15 |
height | | 20 |
spacing | 0 | 2 |
See also :
The progress bar has a 3dfx border (lines 22-23):
Property | Value | Default |
class | | progressBorder%s |
width | 1 | 0 |
style | inset | solid |
color | white | #000000 |
See also :
And the percent text info is right aligned on top side of the progress bar (lines 24-30):
Property | Value | Default |
class | | progressPercentLabel%s |
width | 198 | 50 |
height | 24 | 0 |
font-size | 14 | 11 |
font-family | | Verdana, Tahoma, Arial |
font-weight | | normal |
color | | #000000 |
background-color | | |
align | right | right |
valign | top | right |
See also :
Source Code
<?php
/**
* Horizontal plain progress bar.
*
* @version $Id: bullit.php,v 1.4 2006/05/24 08:47:05 farell Exp $
* @author Laurent Laville <pear@laurent-laville.org>
* @package HTML_Progress2
* @subpackage Examples
* @access public
*/
require_once 'HTML/Progress2.php';
$pb = new HTML_Progress2();
$pb->setAnimSpeed(200);
$pb->setIncrement(10);
$pb->setCellAttributes(array(
'active-color' => '#000084',
'inactive-color' => '#3A6EA5',
'width' => 20,
'spacing' => 0
));
$pb->setBorderPainted(true);
$pb->setBorderAttributes('width=1 style=inset color=white');
$pb->setLabelAttributes('pct1', array(
'width' => 198,
'height' => 24,
'font-size' => 14,
'valign' => 'top',
'align' => 'right'
));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Bullit Progress2 example</title>
<style type="text/css">
<!--
<?php echo $pb->getStyle(); ?>
body {
background-color: #C3C6C3;
}
-->
</style>
<?php echo $pb->getScript(false); ?>
</head>
<body>
<?php
$pb->display();
$pb->run();
?>
</body>
</html>