Sunday, December 17, 2006

Image fade with MochiKit

MochiKit rocks. I needed to add an image fade for a site I am revamping and it was suprisingly easy using Mochikit. Go here for an example. Here's the relevant code

var deedee = new Image();
deedee.src = 'images/deedee.gif';
var dexter = new Image();
dexter.src = 'images/dexter.jpg';


function onImageMouseover(){
fade("bigPic", {"to" : "0.1", "duration" : "0.4",
"queue" : "break", afterFinish: function () {
$("bigPic").src = dexter.src;
appear('bigPic', {"duration" : "0.4", "queue" : "break"});
}});
}

function onImageMouseout(){
fade("bigPic", {"to" : "0.1", "duration" : "0.4",
"queue" : "break", afterFinish: function () {
$("bigPic").src = deedee.src;
appear('bigPic', {"duration" : "0.4", "queue" : "break"});
}});
}

Saturday, December 2, 2006

Insanely Great

I've been reading Stephen Levy's book about the rise of the Macintosh - Insanely Great. It's a really good read if a little dated. I still remember that tingly feeling when I first saw a Mac Plus and it really was insanely great for it's time. We owe a lot to the Mac and the emphasis on instant usability and intuitive interfaces is something we would do well to emulate in our fancy Web 2.0 interfaces.