MooTools Tutorials
Event Delegation with MooTools, Dojo, and jQuery
I've covered the ins and outs of event delegation within JavaScript a few weeks ago but most developers utilize JavaScript frameworks so I thought I'd take a few moments to show you how to implement this wonderful event strategy with the MooTools, Dojo, and jQuery JavaScript frameworks.
JSONP with jQuery, MooTools, and Dojo
We all know that the big limitation of AJAX is that cross-domain requests aren't allowed. We also know, however, that we skirt around that rule a bit by using JSONP. JSONP is the process of SCRIPT tag injection, referencing a cross-domain URL and providing a callback function (on your page) that the provider will call so that you can handle the result. Let's take a look at how JSONP is handled with jQuery, MooTools, and the Dojo Toolkit. For our examples, we'll pull tweets from Twitter with the term "Arsenal" in them.
RealTime Stock Quotes with MooTools Request.Stocks and YQL
It goes without saying but MooTools' inheritance pattern allows for creation of small, simple classes that possess immense power. One example of that power is a class that inherits from Request, Request.JSON, and Request.JSONP: Request.Stocks. Created by Enrique Erne, this great MooTools class acts as a wrapper for Request.JSON and Yahoo!'s YQL service. Let me show you how to user Enrique's awesome MooTools JavaScript class!
MooTools Star Ratings with MooStarRating
I've said it over and over but I'll say it again: JavaScript's main role in web applications is to enhance otherwise boring, static functionality provided by the browser. One perfect example of this is the Javascript/AJAX-powered star rating systems that have become popular over the past five years. Star rating systems are attractive, allow us to avoid ugly forms, and prevent unnecessary page reloads. A new plugin by Lorenzo Stanco called MooStarRating has hit the MooTools Forge and I wanted to share with you how to use it.
Translate Content with the Google Translate API and JavaScript
Note: For this tutorial, I'm using version1 of the Google Translate API. A newer REST-based version is available.
Create an Exploding Logo with CSS3 and MooTools or jQuery
When MooTools contributor and moo4q creator Ryan Florence first showed me his outstanding CSS animation post, I was floored. His exploding text effect is an amazing example of the power of CSS3 and a dash of JavaScript. I wanted to implement this effect on my new blog redesign but with a bit more pop, so I wrote some MooTools code to take static image and make it an animated, exploding masterpiece. Let me show you how I did it, and as a bonus, I'm created a snippet of jQuery that accomplishes the same effect.
Conditional CSS with MooTools’ Browser Object
Whether we want to admit it or not, we all need a bit of browser-specific or even version-specific CSS sometimes. We try to follow standards but in the end we're at the mercy of browsers. And you know what? Browsers sometimes have bugs that cause us these CSS issues. We all know how to use Internet Explorer's conditional comments but other browsers don't provide those methods. Using MooTools' Browser object, however, you can modify your page's HTML tag, adding CSS classes to help create useful conditional CSS for any browser.
Script Junkie: MooTools Class Creation and Organization
My new blog post has debuted on Script Junkie: MooTools Class Creation and Organization!!
Create Spinning, Fading Icons with CSS3 and MooTools
A goal of my latest blog redesign was to practice what I preached a bit more; add a bit more subtle flair. One of the ways I accomplished that was by using CSS3 animations to change the display of my profile icons (RSS, GitHub, etc.) I didn't want to abandon CSS animations completely though; I added a bit of MooTools to randomize the icon's initial display position and rotation. Let me show you how to use CSS3 and MooTools to create dymanic, rotating elements.
MooTools ASCII Art
I didn't realize that I truly was a nerd until I could admit to myself that ASCII art was better than the pieces Picasso, Monet, or Van Gogh could create. ASCII art is unmatched in its beauty, simplicity, and ... OK, well, I'm being ridiculous; ASCII art is good for a few giggles but that seems to be it. A new MooTools class has hit the Forge: MooAsciiArt. Let's have some fun by turning images and DOM nodes into glorious, character-driven ASCII art.