Q&A

What kind of icons are used in jQuery Mobile?

What kind of icons are used in jQuery Mobile?

A set of built-in icons in jQuery Mobile can be applied to buttons, collapsibles, listview buttons and more. There is an SVG and PNG image of each icon. By default the SVG icons, that look great on both SD and HD screens, are used.

How to use data icon in jQuery widgets?

In widgets where you set the icon with a data-icon attribute you use the name of the icon as value. For example: data-icon=”arrow-r”. To add an icon to link buttons and button elements, use the name prefixed with ui-icon- as class.

How to add an icon to a button in jQuery?

In widgets where you set the icon with a data-icon attribute you use the name of the icon as value. For example: data-icon=”arrow-r”. To add an icon to link buttons and button elements, use the name prefixed with ui-icon- as class. For example: ui-icon-arrow-r. See also button markup.

How to enable icon Shadow in jQuery Mobile?

Set data-iconshadow=”true” to enable icon shadow for input buttons, or add class ui-shadow-icon to your button markup. Note: Icon shadow (option iconShadow in the button widget and class ui-shadow-icon) is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0.

Adding Icons to jQuery Mobile Buttons. To add an icon to your button, use the ui-icon class, and position the icon with an icon position class (ui-btn-icon-pos): Note: For other buttons, like buttons in list views and forms, you must use the data-icon attribute.

Is the icon Shadow deprecated in jQuery Mobile?

Note: Icon shadow (option iconShadow in the button widget and class ui-shadow-icon) is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. The semi-transparent dark circle behind the icon ensures good contrast on any background color so it works well with the jQuery Mobile theming system.

How to change the color of icons in jQuery?

Example of the class being applied to a wrapper. Icons are white by default but you can switch to black icons by adding the ui-alt-icon class to the element or its container. This also changes the color that is used for the discs. Example of the class being applied to a wrapper.

Where do icons go in a button in jQuery?

By default, icons in input buttons are placed to the left of the button text. This default may be overridden using the data-iconpos attribute to set the icon position to “right”, “top”, or “bottom”. In case of link buttons or button elements you have to add an icon position class (ui-btn-icon-[value]).

What do you need to know about jQuery Mobile?

The jQuery Mobile framework includes a selected set of icons most often needed for mobile apps. To minimize download size, jQuery Mobile includes a single white icon sprite, and automatically adds a semi-transparent black circle behind the icon to ensure that it has good contrast on any background color.

How do you make an icon in jQuery?

The semi-transparent dark circle behind the icon ensures good contrast on any background color so it works well with the jQuery Mobile theming system. If you prefer to not have this disc, it can be removed by adding the class ui-nodisc-icon to the element or its container. Example of the class being applied to a wrapper.

How does a collapsible work in jQuery Mobile?

Collapsibles are simple widgets that allow you to expand or collapse content when tapped and are useful in mobile to provide a compact presentation of content. Basic collapsible To create a collapsible block of content, create a container and add the data-role=”collapsible”attribute.

What is the value of collapsed icon in jQuery?

The attribute data-collapsed-icon=”arrow-r” is explicitly specified, since the use of the ui-icon-arrow-r class on the anchor element indicates that the value of the “collapsedIcon” widget option is to be “arrow-r”.

How does a collapsible header work in jQuery?

The framework will style the header to look like a clickable button and add a “+” icon to the left to indicate it’s expandable. After the header, add any HTML markup you want to be collapsible. The framework will wrap this markup in a container that will be hidden/shown when the heading is clicked.