MooTools Powered CSS Sprites

Thursday, February 19th, 2009 @ 10:15 am | filed under: Best Practices, MooTools

A few months back David Shea wrote an article on A List Apart about CSS sprites that inspired Uruguayan MooTools developer Gonzalo Rubio (aka gonchuki) to take the practice and apply using MooTools:

While the original version used jQuery (1.2.6 at that time) and lots of people like it, we (mootoolers) have a different approach to code specially emphasizing on OOP techniques and readability. Part of the issue might not be jQuery per-se and be Dave’s code that was a little obfuscated, but it anyways has a lot of room for improvement.

This article will just describe differences between the MooTools implementation and the Dave’s jQuery one, so unless stated otherwise, everything from the ALA article applies here.

new Sprites2({mode: 'fade', item_selector: 'ul.nav a', duration: 250});

(this is just a screenshot from the post)

picture-21

Check out the full post for details and to download the code.

Comments are closed.