最终的效果如下:

step.inc.php 安装步骤效果类:
/**
* step.inc.php 安装步骤效果类 *
* 从Comsenz产品的数据表安装效果中提取出主要代码,以供大家学习
* @author tianxin
* @version 1.0.0 *
*/
class StepClass {
function show_header() {
define('SHOW_HEADER', TRUE);
$step = 1;
$version = 'beta1.0';
$release = '20100223';
$install_lang = '简体中文UTF8版';
$title = '仿Comsenz安装';
$charset = 'uft-8';
echo
<script type="text/javascript"> <br>function $(id) { <br>return document.getElementById(id); <br>} <br>function showmessage(message) { <br>$('notice').value += message + "\r\n"; <br>} <br></script>
$title
$version $install_lang $release
EOT;
$step > 0 && $this->show_step($step);
}
function show_step($step) {
$laststep = 4;
$title = '仿Comsenz安装';
$comment = '正在执行操作';
$stepclass = array();
for($i = 1; $i $stepclass[$i] = $i == $step ? 'current' : ($i }
$stepclass[$laststep] .= ' last';
echo
- 1
- 2
- 3
- 4
EOT;
}
function show_install() {
?>
<script type="text/javascript"> <br>function showmessage(message) { <br>document.getElementById('notice').value += message + " "; <br>} <br>function initinput() { <br>window.location='http://www.jb51.net'; <br>} <br></script>
}
function runquery() {
for($i=1;$i{
$this->showjsmessage('执行操作'.' '.$i.' ... '.'成功');
//模拟每执行完一个动作的延时
sleep(1);
}
}
function showjsmessage($message) {
echo '<script type="text/javascript">showmessage(''.addslashes($message).' ');</script>'." ";
flush();
ob_flush();
}
function show_footer($quit = true) {
echo











