nextwebgen.com

The Next Generation Web Now

Thomas Fuchs uses Script.aculo.us 2.0 on his own site

Filed under: Web 2.0 News — Dion Almaer at 9:13 am on Friday, November 30, 2007

Thomas Fuchs is back in the consulting game and his new site gives us another glimpse of Script.aculo.us 2.0 abilities.

The photo zooming?

JAVASCRIPT:

  1.  
  2. Effect.PhotoZoom = Class.create(Effect.Element, {
  3.   setup: function() {
  4.     var currentHeight = $(‘text’).getHeight();     
  5.     var newHTML = this.element.next(‘div.text’).innerHTML;
  6.    
  7.     var left =  Thomas.photos.indexOf(this.element)*120 + 90;
  8.     var color = $w(‘ffa ffa ffa ffa ffa’)[Thomas.photos.indexOf(this.element)];
  9.      
  10.     $(‘text_contents’).show().update(newHTML).setStyle({height:‘auto’});
  11.     var newHeight = $(‘text_contents’).getHeight()+22;
  12.    
  13.     Thomas.clearTextBox();
  14.     $(‘text’).setStyle({height:currentHeight+‘px’});
  15.    
  16.     $(‘text’).morph(‘left:’+left+‘px;height:’+newHeight+‘px;background-color:#’+color,{
  17.       duration: 1.2,
  18.       transition: ‘linear’,
  19.       propertyTransitions: {
  20.         left: ‘bouncePast’,
  21.         height: ‘bouncePast’,
  22.         backgroundColor: ’sinusoidal’
  23.       },
  24.       after: function(){
  25.         $(‘text_contents’).show();
  26.         Element.update.defer(‘text_contents’, newHTML);     
  27.       }
  28.     });
  29.    
  30.     this.animate(‘zoom’, this.element, {
  31.       propertyTransitions: this.options.propertyTransitions || { }
  32.     });
  33.   }
  34. });
  35.  

Thomas Fuchs

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>