nextwebgen.com

The Next Generation Web Now

Favicon access via JavaScript

Filed under: Web 2.0 News — Dion Almaer at 11:01 pm on Thursday, January 31, 2008

Michael Mahemoff has released an update to his JavaScript library that gives you access to play with favicons from script.

The main point of this library is to update the favicon via Javascript, but at a higher level, its main objective is to provide some support for notifying the user of events in another tab. For example, if you start playing music in another tab, you can make a one-liner call to change the favicon to a sound. Or if you really need to alert the user, you can start animating it.

The new features include:

  • Scrolling title. The window/tab title scrolls. (Title blink is coming. No, really!)
  • Stop functions. unanimate() and unscroll() will stop animation and scrolling, respectively. Previously you had to do stop animation indirectly, by calling change().
  • Rails/Scriptaculous style options Changed config to be fn(mainarg, optionalHash). Read the library or demo source to see the details.

Usage code:

JAVASCRIPT:

  1.  
  2. favicon.change(“/icon/active.ico”, “new title”); // Cancels any animation/scrolling
  3. favicon.change(“/icon/active.ico”); // leaves title alone. Cancels any animation.
  4. favicon.change(null, “new title”); // leaves icon alone. Cancels any scrolling.
  5. favicon.animate([“icon1.ico”, “icon2.ico”, …]);
  6. favicon.animate([“icon1.ico”, “icon2.ico”, …], {delay: 500} );
  7.  
  8. // Tip: Use "" as the last element to make an empty icon between cycles.
  9. // Default delay is 2000ms
  10. // animate() cancels any previous animation
  11. favicon.scrollTitle(“new title”);
  12. favicon.scrollTitle(“new title”, { delay: 200, gap: “——”} )
  13.  
  14. // delay is delay between each scroll unit
  15. // gap is string appended to title (default: "    ")
  16. // scrollTitle() cancels any previous scrolling
  17. favicon.unscroll();
  18. favicon.unanimate();
  19.  

Check out a couple of demos:

This also caused Michael to talk about taking tabs seriously and how:

The browser is the new operating system, the tab is the new system process, the tab bar is the new taskbar.

He gives us a slew of ways in which he would like to see tabs improved upon: notifications, hunting sound, custom favicons, summary list, smart colour, javascript events, open forms, search, virtual desktop, and auto-remove.

Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blogmarks
  • del.icio.us
  • De.lirio.us
  • digg
  • NewsVine
  • YahooMyWeb

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>