PHP & JavaScript Room :: 設置サンプル

実行結果

Control.ProgressBar: CSS based progress bar widget for Prototype | 設置サンプル

▼クリックすると、現在のステータスにプラスされます。

設置サンプルのソース

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta http-equiv="Content-Language" content="ja" />
      <meta http-equ
      iv="Content-Script-Type" content="text/javascript" />
      <meta http-equiv="Content-Style-Type" content="text/css" />
      <meta http-equiv="imagetoolbar" content="no" />
      <title>Control.ProgressBar | 設置サンプル</title>
      <link rel="stylesheet" type="text/css" href="/content/lib/global.css" />
      <script src="/content/lib/prototype/prototype-1.6.0.3.js"></script>
      <script src="/content/lib/livepipe-ui/livepipe.js"></script>
      <script src="/content/lib/livepipe-ui/progressbar.js"></script>
      <script type="text/javascript">
         document.observe('dom:loaded',function(){
            var progress_bar = new Control.ProgressBar('progress_bar',{
               interval: 0.15
            });
            $('progress_bar_stop').observe('click',progress_bar.stop.bind(progress_bar));
            $('progress_bar_start').observe('click',progress_bar.start.bind(progress_bar));
            $('progress_bar_reset').observe('click',progress_bar.reset.bind(progress_bar));
            $('progress_bar_step_5').observe('click',progress_bar.step.bind(progress_bar,5));
            $('progress_bar_step_25').observe('click',progress_bar.step.bind(progress_bar,25));
         });
      </script>
      <style type="text/css">
         #progress_bar { width:102px; height:7px; border:1px solid #ccc; padding:0; margin:0; position:relative; background-image:url(/content/img/ajax/progress_bar.gif); background-repeat:repeat-x; }
         #progress_bar div { background-color:#fff; }
      </style>
   <link rel="stylesheet" type="text/css" href="/common/css/example.css"></head>
   <body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP &amp; JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
      <div id="wrap">
         <h1><a href='http://livepipe.net/control/progressbar'>Control.ProgressBar: CSS based progress bar widget for Prototype</a> | 設置サンプル</h1>
         <div id="progress_bar"></div>
         <div style="margin-top:10px;">
            <p>
               <input type="button" value="開始" id="progress_bar_start" />
               <input type="button" value="停止" id="progress_bar_stop" />
               <input type="button" value="リセット" id="progress_bar_reset" />
            </p>
            <p>
               ▼クリックすると、現在のステータスにプラスされます。<br>
               <input type="button" value="+ 5%" id="progress_bar_step_5" />
               <input type="button" value="+ 25%" id="progress_bar_step_25" />
            </p>
         </div>
      </div>
   </body>
</html>