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开发者_运维知识库>
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.
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>
精彩评论