part2-firstprogressmeter.pkg

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PKG 代码 · 共 61 行

PKG
61
字号
<?xml version="1.0" encoding="iso-8859-1" ?>
<!-- $Revision $ -->

<refentry id="{@id}">

 <refnamediv>
  <refname>Your first Progress Meter</refname>
  <refpurpose>first steps in the HTML_Progress World</refpurpose>
 </refnamediv>

 <para>
   We will start by creating a very simple progress meter. Copy the following code to a file, 
   give it a .php extension, and display it in your browser.
   <example><title>code listing 2.1: a very simple progress meter</title>
    {@example listing-2.1.php}
   </example>
   Loading this file in your browser will simply show something like that after few seconds :
   <para>
    <figure>
     <graphic fileref="../media/screenshots/scratch21.png"/>
    </figure>
   </para>
   <para>
    Not particulary exciting, but this does show that HTML_Progress is installed correctly 
    and working. If it's not, have a look at the FAQ page to know if your problem is identified.
   </para>
   <para>
    Let's consider the lines individually:
   </para>
   <para>
    <emphasis>Line 2</emphasis> loads the class definitions. 
    Next (<emphasis>line 4</emphasis>) we instanciate an HTML_Progress object.
   </para>
   <para>
    <emphasis>Line 5</emphasis>, we slow a bit the animation, to see something. By default animation speed is set to 
    zero, and we can think in such case that the progress meter did not run, or just jump from
    0 to 100 without doing nothing else. It's false! 
   </para>
   <para>
    Stylesheet produced by PEAR::HTML_CSS package is put between style html tags in 
    <emphasis>line 12</emphasis>.
   </para>
   <para>
    Javascript is put between script html tags in <emphasis>line 17</emphasis>.
   </para>
   <para>
    In <emphasis>line 24</emphasis>, we produces all the html code necessary 
    to display the progress meter.
   </para>
   <para>
    Finally, the <emphasis>line 25</emphasis> makes it happen. 
    This display the horizontal progress bar and run it from 0% to 100%, one percent step by step.
   </para>
   <para>
    Of course, in this example there isn't anything the user can do, so let's create a more complex
    example.
   </para>
 </para>

</refentry>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?