O'Reilly logo

jQuery Mobile Cookbook by Chetan K Jain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Replacing the default icon sprite

This recipe shows you how to replace the default icon sprite provided with jQuery Mobile and use your own instead. The custom icon sprite used here contains icons which form the six faces of a dice.

Getting ready

Copy the full code of this recipe from the code/04/replace-icon-sprite sources folder. You can launch this code using the URL http://localhost:8080/04/replace-icon-sprite/main.html.

How to do it...

In this recipe, the following image, dice.png is an icon sprite with six icons for the six faces of a dice. This icon sprite is used to replace the default icon sprite.

How to do it...
  1. Create a new stylesheet jqm-sprite.css and redefine ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required