Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

ui-icon-alt #46

Closed
Slimicus opened this issue Jul 9, 2013 · 4 comments
Closed

ui-icon-alt #46

Slimicus opened this issue Jul 9, 2013 · 4 comments

Comments

@Slimicus
Copy link

Slimicus commented Jul 9, 2013

Are alt icons supported for the original icon set? I see them defined, but when I add the class to a data-role="button" element, it's not appearing correctly for me (and when I add it to your original example page it also causes issues)

@commadelimited
Copy link
Owner

Could you provide some additional detail please @Slimicus? A code sample or demo URL would be ideal.

@Slimicus
Copy link
Author

Sure thing, when I alter the original\index.html sample to this:

<a href="index.html" data-role="button" data-icon="arrow-l" class="ui-icon-alt">
    data-icon="arrow-l"
</a>

(notice the addition of class="ui-icon-alt")

This happens:

http://i.snag.gy/eaXQm.jpg

@commadelimited
Copy link
Owner

jQuery Mobile icons work on the concept of sprite sheets. That means all of the icons are contained within a single image, for faster loading. Since they're all in one image they're meant to be used within a single space around 20x20, with overflow set to hidden. This prevents them from doing exactly what's happening to you.

This image is a good illustration of how sprite sheets are meant to work. The image contains all of the icons, but only one is being used at a time, contained within the black box.

7263_11_31

So, long and short of it, you can't just apply that class to the anchor tag like you can with some of the other jQuery Mobile styles.

@Slimicus
Copy link
Author

Ok, I just followed the example on the jqm site, I wasn't aware of any other way to use ui-alt-icon with an anchor tag in jqm?

http://jquerymobile.com/demos/1.3.0/docs/widgets/icons/#Blackvs.whiteiconsets

Their example shows just adding the class to the "<a"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants