Archive for the ‘UX’ Category

A jQuery Counter Plugin

Overview

A jQuery counter based on http://code.google.com/p/jquery-countdown with extra options like the ability to count up.

  • Format: fully customized using an element attribute or an init option
  • Direction: Up or Down
  • Stop: fully customized using an element attribute or an init option
  • Appearance: fully customized using CSS3
  • License: MIT

View Demo on GitHub

jQuery Counter

Options

Options can be set by attribute data-<name>="value" or in the options hash on counter initialization: $(element).counter({name: value, ...})

  • direction: up|down Counter direction – default: down
  • format: string Defines the number of parts and the maximum number for each of them – default: 23:59:59
  • interval: number Sets the increment/decrement in milliseconds – default 1000
  • stop: string Sets the counter stop number – default: maximum number allowed by the format.

Events

  • counterStop: Raised when the counter reaches the stop number
$('.counter').on('counterStop', function() {
    //code
});

Usage

10 seconds countdown:

<span class="counter">0:10</span>
<script type="text/javascript">// <![CDATA[
  $('.counter').counter();
// ]]></script>

120 seconds count:

<span class="counter" data-direction="up" data-format="120">0</span>
<script type="text/javascript">// <![CDATA[
  $('.counter').counter();
// ]]></script>

Binary counter stopping at 001000000 (note the spaces between the binary digits):

<span class="counter" data-direction="up" data-format="1 1 1 1 1 1 1 1" data-stop="">0 0 1 0 0 0 0 0</span>
<script type="text/javascript">// <![CDATA[
  $('.counter').counter();
// ]]></script>

Download

You can download jquery-counter from Github.


Seven free icon sets to use with @font-face

Remember, icons are needed on most of the web applications, they provide a simple way of adding elegance and usability to your site.
Nowadays, choosing the correct icon set at the beginning of a project is very important, so here I share the results of a quick research that show different options.
As you can see, I prioritize the solutions that uses @font-face because you can easily change the icon sizes, colors and apply any CSS style without loosing quality.

Entypo

Entypo is a set of pictograms available as vector EPS, OpenType font and web font (coming soon). All released for free under the Creative Commons license CC BY-SA.

entypo

Iconic

Iconic is an open source icon set consisting of 171 marks in raster, vector and font formats.

iconic

Zurb

A custom @font-face icon set from ZURB

zurb

Font Awesome

A complete icon set designed for use with Twitter Bootstrap.

font-awesome

Socialico

Socialico is a package of 74 social media icons

socialico

Heydings

Another great icon set using @font-face.

heydings

Octicons

Github’s icons font.

octicons

And one last thing

Fontello is the google web fonts for icons. This is a great starting point if you want a place to find @font-face icon sets.

Enjoy and please come with your thoughts.