Categories

.addSprite()

Categories: CSS

.addSprite( name, [ size ] )

Subclass: ep

Plugin: ep.fn.sprite

Description: Add sprite icon classes to each of the set of matched elements.

  • .addSprite( name, [ size ] )

    version added: 6.11.0

    name   A sprite icon name.

    size   Size of the icon (xs, s, l, m, l, xl, 64, 128), Default: m.

The .addSprite() method adds classes, which set size an an background image (icon), to each of the set of matched elements.

  • Create classes for arrow top-bottom icon in size of 16px to matched element.

    Code:
    ep('#icon').addSprite( 'arrow-tb', 's' );