Follow ryanflorence on Twitter

Articles on JavaScript

NPM + MooTools + Ender = <3

Published May 12, 2011 Issue #005 Topic: JavaScript Tags: MooTools, NPM, Ender

A proof-of-concept for the future of MooTools and client-side libraries. I've broken MooTools down to separate modules, published them on npm, and can now build them with ender.

JavaScript Micro Libraries

Published May 12, 2011 Issue #005 Topic: JavaScript Tags:

A new movement I'm excited about. There's only one article right now, but more will be coming.

MooTools Element 1.3

Published November 13, 2010 Issue #004 Topic: JavaScript Tags: MooTools

The Element module in MooTools is your gateway to the DOM. In addition to creating, selecting, and manipulating elements, it features element getters, setters, and storage. Also, the Element module, along with Slick, provide a few more of places to put your code.

MooTools Events 1.3

Published November 12, 2010 Issue #004 Topic: JavaScript Tags: MooTools

Events are the communication lines between objects. What's exciting about client-side JavaScript to me is the changing state of a page as the user interacts. Without events, there would be no way to manage the state of all your objects and create a dynamic experience.

MooTools Class 1.3

Published November 11, 2010 Issue #004 Topic: JavaScript Tags: MooTools

Welcome to JavaScript with Class. The Class type in MooTools is one of the defining parts of the framework. The sooner you master Class, the sooner you'll write maintainable, extensible MooTools code. After MooTools Core establishes a few things, nearly every other addition to the framework is a class.

MooTools Types 1.3

Published November 10, 2010 Issue #004 Topic: JavaScript Tags: MooTools

MooTools upgrades the JavaScript environment with dozens of utility methods and functions by extending the native Types. This enhancement sets a foundation, across environments, for the rest of MooTools itself and your application.

Three-Minute MooTools

Published November 09, 2010 Issue #004 Topic: JavaScript Tags: MooTools

You won't get this from the docs. The essence of MooTools in three minutes flat.

MooTools 1.3

Published November 08, 2010 Issue #004 Topic: JavaScript Tags: MooTools

There's a lot of talk lately about large applications and how they affect how people are writing JavaScript--namely, a focus on modularity, reuse, and testability. This issue takes a deep look at MooTools 1.3 and its prescribed patterns for writing and organizing your JavaScript.

Providing Options in jQuery Plugins

Published October 05, 2010 Issue #003 Topic: JavaScript Tags: jQuery

Nothing new or extraordinary here, but I run across enough jQuery plugins that don't provide options to warrant writing an article about it. You can meet a lot more use cases for your plugin if you provide the developer with some options.

jQuery.addObject - Managing a Plugin's State With the jQuery API

Published October 05, 2010 Issue #003 Topic: JavaScript Tags: jQuery

Most plugins ought to provide a way for the developer to interact with it. Think of the holy accordion. Outside of just the click event on the togglers, you should provide a way to show a certain panel arbitrarily. The jQuery.addObject method to the rescue.

Use Your Fn jQuery Namespace

Published October 05, 2010 Issue #003 Topic: JavaScript Tags: jQuery

Every plugin gets a namespace on the jQuery prototype. If you keep all of your functions, methods, and variables scoped inside the jQuery.fn function, others can't extend or alter the functionality of your plugin. Instead, take advantage of your block on jQuery street and let other developers take advantage of your plugin.

Authoring jQuery Plugins With Object Oriented JavaScript

Published October 05, 2010 Issue #003 Topic: JavaScript Tags: jQuery

Instead of wrapping all the plugin logic inside the $.fn.disables = fn, keep all the logic outside in its own object and just use effin' to add your object to the jQuery API. It allows others to extend your plugin with ease, and allows you to skip the whole jQuery API, if you so desire.

Templating With Narwhal Server-Side JavaScript and Json-Template

Published June 11, 2010 Issue #000 Topic: JavaScript Tags: narwhal

Server-side JavaScript is all the rage. Here's a practical application of JavaScript that I used today. I needed to populate a bunch of html files with some data so I did it with narwhal and json-template

Fx.Scroll, Fx.Morph, Fx.Elements, and MooTools 1.3 Unified Timer

Published June 09, 2010 Issue #000 Topic: JavaScript Tags: MooTools

MooTools 1.2 has a few different ways to animate elements. A friend of mine recently asked what the difference was with each. What adds more to the fun is that MooTools 1.3 has some internal stuff going on that almost makes the differences meaningless!

News Feed Ticker With MooTools SlideShow

Published June 08, 2010 Issue #000 Topic: JavaScript Tags: MooTools, SlideShow

Creating an animated news feed, or ticker as they are often called, is a snap with SlideShow

SlideShow 1.0 Released!

Published June 04, 2010 Issue #000 Topic: JavaScript Tags: MooTools, SlideShow

It's not just a gallery plugin, this thing can handle any content that shares the same space (tabs, news feeds, etc.) It's now super flexible after I've used it in production on several sites and discovered scenarios I hadn't thought of before.

Introducing moo4q.com

Published May 10, 2010 Issue #000 Topic: JavaScript Tags: MooTools, jQuery, moo4q

I've gotten some great response to combining MooTools Class with jQuery, therefore, I've created a site dedicated to the technique.

Options in Sub-Classes With Mixins Still Works!

Published April 27, 2010 Issue #000 Topic: JavaScript Tags: MooTools, Video

When Extending and Implementing classes, you can have options specific to each class and they will all be merged nicely together in the final class. Check it out!

jQuery Conference Slides and Demo

Published April 24, 2010 Issue #000 Topic: JavaScript Tags: MooTools, jQuery

Just spoke at jQuery conference, the largest javascript conference to date. Here are my slides.

Javascript Base64 Turns a Table Into CSV

Published April 04, 2010 Issue #000 Topic: JavaScript Tags: MooTools

I decided to tinker with MooTools and Base64 and see if I could avoid the server altogether to create some CSV out of an html table.

Extending Element With Your MooTools Class Is Awesome

Published March 16, 2010 Issue #000 Topic: JavaScript Tags: MooTools

Almost every class that is centered around an element deserves a few element shortcuts. You've used them plenty of times already but maybe you haven't written one.

Three Things You Should Do With an Element-Based MooTools Class

Published March 16, 2010 Issue #000 Topic: JavaScript Tags: MooTools

Is your MooTools class centered around an element? Here are three things you ought to be doing with it that you probably aren't.

Object Oriented jQuery With MooTools (Pigs Take Flight)

Published March 04, 2010 Issue #000 Topic: JavaScript Tags: MooTools, jQuery, moo4q

If Element and jQuery as a whole are practically the same, what's the big difference? Remove the overlap of the two frameworks and you're left with the inheritance API of MooTools. What happens if you use this API from MooTools and plug in jQuery for everything else? Yep, jQuery as a plugin for MooTools. Or inversely and maybe more appropriate, MooTools Object Oriented Programming for jQuery.

11 Tips for Creating Great MooTools Plugins

Published February 16, 2010 Issue #000 Topic: JavaScript Tags: MooTools

Here's a sort of "best practices" that I follow when creating mootools classes in no particular order whatsoever.

jQuery 1.4, MooTools 1.2 Compared

Published February 05, 2010 Issue #000 Topic: JavaScript Tags: MooTools, jQuery

I recently read jQuery 1.4 Released, The 15 New Features you Must Know over at Nettuts and thought it would be interesting to compare the features of MooTools 1.2 to the new features in Jquery 1.4, released 18 months later. Enjoy!

MooTools ThreeSixty Viewer Featuring the iPad

Published February 01, 2010 Issue #000 Topic: JavaScript Tags: MooTools

I thought Apple's new 360 degree product viewer was flippin' awesome. So I created a feature light version in mootools last night. I hope to add more (like throwing) and clean up the api a bit, but still, this is sweet.

Question, Why Did You Choose MooTools?

Published January 30, 2010 Issue #000 Topic: JavaScript Tags: MooTools

A simple question

MooTools Fx.Transitions Demo

Published January 28, 2010 Issue #000 Topic: JavaScript Tags: MooTools

The old demos for mootools 1.11 had a fun little widget that showcased the different transitions available in mootools. I've recreated it here. Just click anywhere in the box to see the transition. Enjoy!

MooTools for Beginners Part 7 - Creating Flexible Classes Using Options, Events, and Event Management

Published January 27, 2010 Issue #001 Topic: JavaScript Tags: MooTools

Last time we compartmentalized some code into a nice little MooTools Class called BouncyMenu that we can use anywhere. However, there are some HUGE improvements to be made. In this article we'll be talking about how to make your MooTools Class flexible by using `Implements`, `Options`, and `Events`. We'll also talk about managing events added to elements and some discussion about binding. If you still consider yourself a beginner, understanding this article should be a big deal. Once you master `Class` your javascript will never be the same.

Screencast, Adding Your Own MooTools Plugins to the Forge

Published January 26, 2010 Issue #000 Topic: JavaScript Tags: MooTools, Video

The MooTools forge is awesome. This screencast shows you how to make it more awesome by adding your own mootools plugins to the forge. It features my newest plugin, Fx.Scroll.Carousel, though I wish I could have done this screencast for [SlideShow](http://mootools.net/forge/p/slideshow) instead, since it's my favorite plugin I've made so far. Enjoy!

MooTools for Beginners Part 6 - Coding an Animated Menu With `Class`

Published January 19, 2010 Issue #001 Topic: JavaScript Tags: MooTools

When I first started working with MooTools I was writing code that was typically a series of functions and a lot of logic inside of my `domready` code. After a while I had a nagging feeling that there was a better way to write code. There is, and it's called `Class`. If MooTools were barbeque, `Class` would be the sauce--and the sauce is the boss.

Event Delegation With Mootools--Quit Selecting All Those Elements!

Published January 16, 2010 Issue #000 Topic: JavaScript Tags: MooTools

Event delegation rules the school. Instead of adding events to 300 elements you just add an event to the parent element and it'll delegate the event down to it's children, like every good parent would. The benefits? 1) Efficiency, 2) Set it and forget it, 3) Makes attaching and detaching events in a class easier, 4) Makes you look cool, and that after all, is the point of being a web developer instead of a surfing instructor.

JQuery 1.4's New 'Until' Methods Caught My Eye ... Introducing Element.GetUntil

Published January 15, 2010 Issue #000 Topic: JavaScript Tags: MooTools, jQuery

So I did what every good mootools developer would ... extended MooTools to do the same.

MooTools for Beginners Part 5 - Native Extensions

Published January 14, 2010 Issue #001 Topic: JavaScript Tags: MooTools

MooTools extends a lot of JavaScript natives, like Functions, Strings, Numbers, etc. This article is going touch on a few of the non-dom things I do regularly with MooTools.

MooTools for Beginners Part 4 - Selecting and Manipulating DOM Elements

Published January 12, 2010 Issue #001 Topic: JavaScript Tags: MooTools

Most of the time the whole point of using mootools is to manipulate an element or collection of elements. (But not always, as you'll see in Part 5.) Now that you know some basics we're going to get more in depth by learning the various ways to select dom elements to manipulate them--traversing the dom, as it were.

MooTools for Beginners Part 3 - Effects (Fx)

Published January 09, 2010 Issue #001 Topic: JavaScript Tags: MooTools

Most people's interest in a javascript framework lies in the animation effects. MooTools has the best. This article will not only show you the various ways to use effects, but will also talk a little about the philosophy of mootools.

Basic AJAX and JSON Requests Using MooTools' Request.HTML and Request.JSON

Published January 02, 2010 Issue #001 Topic: JavaScript Tags: MooTools

Ajax and JSON requests can subtly enhance the usability of a site where the user doesn't notice the site thinking as much as all the page loads of yesteryear. After going through this tutorial you'll have a solid foundation to use this powerful feature of the web with mootools.

SlideShow - a Highly Extendable MooTools Javascript Slideshow

Published January 01, 2010 Issue #000 Topic: JavaScript Tags: MooTools, SlideShow

It seems with every new brochure-type website I worked on I was coming up a with a new slideshow/gallery widget. Finally I made Slideshow, the ultimate slideshow class. It handles all of the basics of a good javascript gallery and nothing else. No skins, no new elements, no navigation, just the slideshow basics, making it a cinch to skin.

MooTools for Beginners Part 2 - Instantiating Objects and Managing State

Published December 30, 2009 Issue #001 Topic: JavaScript Tags: MooTools

In part one we made use of `Element.tween`. A lot of the mootools classes have what I call element shortcuts that look like `$('el').tween()`, `.morph()`, `.load()` etc. Instead of using these shortcuts you can create an instance of these classes in an object and open up a lot more control.

MooTools for Beginners Part 1 - the Basics

Published December 29, 2009 Issue #001 Topic: JavaScript Tags: MooTools

This is basic tutorial to help get you started with mootools. We'll be manipulating elements, adding and removing event listeners, and playing with magic.