Viewport Component, grunt-saucelabs, FastClick

2012-11-30 00:00:00 +0000 by Alex R. Young

Viewport Component

Viewport Component (License: MIT, component: pazguille/viewport) by Guille Paz can be used to get information about a browser's viewport. This includes the width and height as well as the vertical and horizontal scroll positions.

It also emits events for scrolling, resizing, and when the top or bottom has been reached during scrolling.

var Viewport = require('viewport')
  , viewport = new Viewport()

viewport.on('scroll', function() {

viewport.on('top', function() {

viewport.on('bottom', function() {


grunt-saucelabs (License: MIT, npm: grunt-saucelabs) by Parashuram N (axemclion) is a Grunt task for qunit and jasmine tests using Sauce Labs' Cloudified Browsers. This is similar to the built-in qunit Grunt task, but uses the remote service provided by Sauce Labs instead.

Sauce Connect can be used to create a tunnel for testing pages that aren't accessible on the Internet.


FastClick (License: MIT, npm: fastclick, component: ftlabs/fastclick) from the Financial Times helps remove the delay in mobile browsers that occurs between a tap and the trigger of click events.

The authors have included some simple tests, documentation, and examples. The project is extremely well packaged, including support for npm, component, AMD, and Google Closure Compiler's ADVANCED_OPTIMIZATIONS.

Internally, FastClick works by binding events to a "layer" and binding several touch event handlers. These handlers use internal properties to determine how elements are being interacted with. If certain conditions are met, then a click event will be generated, and several attributes will be added to the event to allow further tracking.

The event handlers can be easily removed using FastClick.prototype.destroy, and the project has a wide range of special cases for handling divergent behaviour in iOS and Android.