Finder
Finder

Reputation: 8711

Add Image on the Button

Any one help me. How to add the image on the button? I am using following code for create a button. I want to display the image instead of "refresh". is it possible to do this? Thanks in advance.

<div data-role="button" data-iconpos="right" id="searchResultRefresh" data-icon="refresh"> 
 refresh </div>

Upvotes: 3

Views: 12694

Answers (2)

naugtur
naugtur

Reputation: 16915

You are interested in this document:

http://jquerymobile.com/demos/1.0a2/#docs/buttons/buttons-icons.html

Custom icons are mentioned at the bottom. Take one of the existing ui-icon-sth classes and change the offsets to refer to the end of the icons file and then add your icon there if you want to reuse it a lot.

If not - just change the image link in the copied CSS and remove background-position definition.

Upvotes: 3

Shadow Wizard
Shadow Wizard

Reputation: 66389

That's not a button, it's a div element.

To have button with image, have such HTML:

<button type="button"><img src="Refresh.gif" /></button>

Upvotes: 1

Related Questions