Setting icons on a jQuery Mobile button
The following example shows how you can specify an icon on a jQuery Mobile button instance using the data-role and data-icon attributes.
<!DOCTYPE html> <!-- http://dhtmlexamples.com/2011/05/05/setting-icons-on-a-jquery-mobile-button/ --> <html> <head> <meta charset="utf-8"/> <title>Setting icons on a jQuery Mobile button</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" /> <script src="http://code.jquery.com/jquery-1.6.min.js" type="text/javascript"></script> <script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js" type="text/javascript"></script> </head> <body> <div data-role="page"> <div data-role="content"> <a href="#" data-role="button" data-inline="true" data-icon="alert">data-icon="alert"</a> <a href="#" data-role="button" data-inline="true" data-icon="arrow-d">data-icon="arrow-d"</a> <a href="#" data-role="button" data-inline="true" data-icon="arrow-l">data-icon="arrow-l"</a> <a href="#" data-role="button" data-inline="true" data-icon="arrow-r">data-icon="arrow-r"</a> <a href="#" data-role="button" data-inline="true" data-icon="arrow-u">data-icon="arrow-u"</a> <a href="#" data-role="button" data-inline="true" data-icon="back">data-icon="back"</a> <a href="#" data-role="button" data-inline="true" data-icon="check">data-icon="check"</a> <a href="#" data-role="button" data-inline="true" data-icon="delete">data-icon="delete"</a> <a href="#" data-role="button" data-inline="true" data-icon="forward">data-icon="forward"</a> <a href="#" data-role="button" data-inline="true" data-icon="gear">data-icon="gear"</a> <a href="#" data-role="button" data-inline="true" data-icon="grid">data-icon="grid"</a> <a href="#" data-role="button" data-inline="true" data-icon="home">data-icon="home"</a> <a href="#" data-role="button" data-inline="true" data-icon="info">data-icon="info"</a> <a href="#" data-role="button" data-inline="true" data-icon="minus">data-icon="minus"</a> <a href="#" data-role="button" data-inline="true" data-icon="plus">data-icon="plus"</a> <a href="#" data-role="button" data-inline="true" data-icon="refresh">data-icon="refresh"</a> <a href="#" data-role="button" data-inline="true" data-icon="search">data-icon="search"</a> <a href="#" data-role="button" data-inline="true" data-icon="star">data-icon="star"</a> </div> </div> </body> </html>
The output from the previous example is as follows:
-
Josh
Archives
- April 2012 (4)
- February 2012 (2)
- December 2011 (1)
- November 2011 (3)
- October 2011 (1)
- September 2011 (1)
- July 2011 (5)
- May 2011 (3)
- April 2011 (8)
- February 2011 (14)
- January 2011 (13)
- December 2010 (14)
- November 2010 (4)
@pdehaan on Twitter
- Code School free weekend http://t.co/1rw1Itux via @codeschool
- Listening to an excellent CSS3 talk by @smcbride (@typekit) at @adobe and @cascadesf #occupyTownsendSt
- RT @OReillyMedia: #Ebook Deal/Day: Learning JavaScript Design Patterns - $11.99 (Save 50%) http://t.co/ilcmSDv6
- Ext JS 4.1.1 RC1 Now Available -- http://t.co/mUPab1LI
- Responsive Web Design Techniques, Tools and Design Strategies http://t.co/Zgu1Pvm3 via @smashingmag
- RT @Sencha: Reminder: Architect 2 webinar this Wednesday at 10 am PT. The team will go through a sample #mobile #HTML5 project. http://t ...
- RT @Sencha: Sencha Devs 2.0 Launched!!! http://t.co/5EC9rwDq #Sencha #Developers #Gigs #extjs #touch
- @gdzambrano Actually, the best place to post would be the forums at http://t.co/gOUctXYm They are pretty active and should be able to help.
Hello Sencha: HTML5 Applications Roadshow
- 2/16/12 - Dallas, TX
- 2/21/12 - San Francisco, CA
- 2/22/12 - San Diego, CA
- 2/27/12 - FITC, Amsterdam
- 2/29/12 - Orange County, CA
- 3/01/12 - London, England
- 3/05/12 - New York, NY
- 3/06/12 - Boston, MA
- 3/07/12 - QCon, London
- 3/08/12 - Chicago, IL
- 3/12/12 - Philadelphia, PA
- 3/13/12 - Atlanta, GA
- 3/14/12 - Washington, DC
- 3/21/12 - Seattle, WA
- 3/22/12 - Nashville, TN
- 3/24/12 - Spotlight JavaScript, Toronto
- 4/15/12 - 360|Flex, Denver
- 4/23/12 - FITC Toronto [via Sencha.com]

