-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathobject.php
More file actions
49 lines (39 loc) · 1.25 KB
/
Copy pathobject.php
File metadata and controls
49 lines (39 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
class ProgressObj{
var $increment;
var $addWidth;
var $text;
function ProgressObj(){
$this->text = "Loading...";
}
function DisplayMeter(){
print(" <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js'></script> ");
print(" <link rel='stylesheet' type='text/css' href='style.css' /> ");
print(" <div class='meter_container'> ");
print(" <h1>" . $this->text . "</h1> ");
print(" <div class='meter'> ");
print(" <span style='width: 0%'></span> ");
print(" <h4></h4> ");
print(" </div> ");
print(" </div> ");
}
function Calculate($count){
$this->increment = 100 / $count;
}
function Animate(){
$this->addWidth += $this->increment;
$rounded = round($this->addWidth, 2);
?><script>
$('.meter > span').stop().animate({width: "<?= $this->addWidth ?>%"}, "fast");
$('.meter > h4').html("Percent done: " + <?= $rounded; ?> + "%");
</script><?php
}
function Hide(){
?><script>
setTimeout(function(){
$(".meter_container").fadeOut();
}, 2000);
</script><?php
}
} //end class
?>