Sunday, October 19, 2008

Class 5 - prototype.js and event observers

Things are getting a little more abstract with the introduction of prototypes. It is a case of learning by example and for this exercise, focusing on event observers, which seem to be very powerful.

I decided to finish what I started in class before trying the Ajax approach. After some trial and error, I got the product info boxes to overlay the product image boxes by finding the corresponding element id, adding classes to show and hide, and using setStyle to give the product info box an absolute position. Here is the latest version:


1 comment:

Amos said...

Very nice so far! Don't forget that when you mouse off of the thumbnail, the product info should disappear.... so you need to do another event observer that detects mouseout events, and makes the product info divs invisible again.