Thomas Fuchs
Hi, I'm Thomas Fuchs. I'm the author of Zepto.js, of script.aculo.us, and I'm a Ruby on Rails core alumnus. With Amy Hoy I'm building cheerful software, like Noko Time Tracking and Every Time Zone and write books like Retinafy.me.
   Want me to speak at your conference? Contact me!

Extreme JavaScript Performance video

December 24th, 2009

The nice folks from JSConf.eu have posted more and more videos of the conference talks, and here’s my talk on Extreme JavaScript performance!
For reference, here are the talk slides, if you want to see an enlarged version/download them:

View more documents from Thomas Fuchs.

Finally, here’s a PDF (750k) of the slides, if you want to read it offline and/or in dead tree form, and there’s a Github Gist of the example code, so you can run it yourself.

Wish you have a happy holiday season & and write lots of fast JavaScript code in 2010! 🙂

Need JavaScript-fu? JavaScript Masterclass Philadelphia in January 2010

December 15th, 2009

Need some JavaScript-fu? Tired of being stuck with not knowing what those magic framework functions do? Want to tweak your code for ultimate performance? Or a mad programming skillz boost for the new Year?

Come visit our full-day JavaScript Masterclass in Philadelphia, on Monday, January 25, 2010, at National Mechanics.

Amy Hoy, teacher extraordinaire and yours truly will show you how to really make JavaScript your bi, ah, strive towards JavaScript excellence.

There are just 20 seats (we like small classes where everyone gets to interact with us!), and we will sell out! We’d hate to hear from your that you wanted to attend but couldn’t grab a seat! 🙂

The course is framework-agnostic, so whether you use and love jQuery, Prototype, Scriptaculous, dojo, YUI or bare-bones JavaScript, you’ll walk away enthused with JavaScript knowledge, and can directly use it in your projects!

Book now and take advantage of our early bird rate of just $349. For that, you’ll get to participate in our full-day workshop plus a free copy of our JavaScript performance ebook “JavaScript Performance Rocks!” (if you already have it, you can gift it to someone else!). Plus we also excel in socializing, so yes, you can have beers with us! 🙂

Simplest Prototype & scripty Slideshow

December 11th, 2009

Here’s a more extended version of my comment on Jonathan Snook’s post on the simplest jQuery Slideshow (good article!).

So here’s my version of the simplest slideshow (done in Prototype/script.aculo.us 1.8), compare to Jonathan’s version in jQuery.

I’ve optimized what’s going on by only fading on element at a time (versus a more processor-hungry crossfade).

The code:

setInterval(function(){
  var imgs = $$('.fadein img'), 
   visible = imgs.findAll(function(img){ return img.visible(); });
  if(visible.length>1) visible.last().fade({ duration: .3 });
    else imgs.last().appear({ duration: .3, 
      afterFinish: function(){ imgs.slice(0,imgs.length-1).invoke('show');  } });
}, 3000);

I don’t really like either my Prototype/scriptaculous nor the jQuery version (which seems too magic for my taste, plus it does two animations at the same time). The main issue with my code is that the CSS has to be reset after a cycle is complete, and this ends up to be quite complicated.

I guess it’s food for thought. 🙂

Sneak preview on scripty2 UI controls

December 3rd, 2009

So how’s scripty2 progressing? To give you some more insight than just “Very well, thank you”, here’s a status update.

Next to the big chunks for the effects engine which has been stable for quite a while now, and the support for multi-touch input (hat tip to Nokia), several additions are queued up, the most important being the “UI behaviours”/”controls” part.

A big Thank You! to Andrew Dupont for adding the first batch of controls goodness to scripty2, including buttons, dialogs, overlays, sliders, autocompleters, and yes, an accordion.

s2ui

Try the scripty2 UI demos! (alpha version, so there are some kinks!)

Those controls are written with the super-nice Prototype class system and custom events, so they’re super-tweakable and make it a snap to create extensions and customized versions. More controls are in the works, and there should be a beta release this year (or grab the code from github).

They support full keyboard navigation and provide accessibility hooks through WAI-ARIA.

The best thing is that they’re compatible with Themeroller (from jQuery UI) themes! So you can just reuse/tweak existing themes very easily, plus scripty2 comes with a special scriptaculous theme, thanks to Samo KoroÅ¡ec.

Bonus– here are two new sightings of scripty2 in the wild:

Enjoy, and hope you’ll build something cool with scripty2, too!