在瀏覽器 favicon 上顯示進度 很帥 很酷

Piecon

Pie charts in your favicon!

A tiny javascript library for dynamically generating progress pie charts in your favicons.

Look up at your tabs for the live demo!

Documentation

Basic usage


Piecon.setProgress(12);
Piecon.setProgress(25);
...
Piecon.reset();

Options


Piecon.setOptions({
  color: '#ff0084', // Pie chart color
  background: '#bbb', // Empty pie chart color
  shadow: '#fff', // Outer ring color
  fallback: false // Toggles displaying percentage in the title bar (possible values - true, false, 'force')
});

Browser Support

Piecon has been tested to work completely in the following browsers (older versions may be supported, but haven't been tested):

  • Chrome 15+
  • Firefox 9+
  • Opera 11+

Currently the library falls back to title updates for the following browsers:

  • Internet Explorer 9
  • Safari 5+
  •  <link rel="icon" href="favicon.ico" /> 
  •    <script src="jquery-1.8.2.min.js"></script>
  •   <script src="piecon.js"></script>
  •   <script>
  •   (function(){
  •  
  •     var count = 0;
  •     Piecon.setOptions({fallback: 'force'});
  •     var i = setInterval(function(){
  •       if (++count > 100) { Piecon.reset(); clearInterval(i); return false; }
  •       Piecon.setProgress(count);
  •     }, 250);
  •   })();
  •   
  •   </script>

不過用着用着應該是個標題黨罷了 沒有什麼實質用處。

我的博客 http://zencart.me

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章