0

The learn.jquery tutorial asks to make a list of buttons with this command:

<ul data-role="listview" data-inset="true" data-filter="true">
<li><a href="#">Acura</a></li>
<li><a href="#">Audi</a></li>
<li><a href="#">BMW</a></li>
<li><a href="#">Cadillac</a></li>
<li><a href="#">Ferrari</a></li>
</ul>

Later, learn.jquery mentions you can customize buttons with the data-role option using data-theme"a"(-"e") by

<a href="#" data-role="button" data-icon="star" data-theme="a">Button</a>

How would I use the superclass, Listview for a theme of a different letter "a"-"b" to alternate colors for the buttons?

Attempt 1 resulted in a non-themed arrow of buttons.

<ul data-role="listview" data-role="button" data-inset="true" data-filter="true">
<li><a href="#" data-theme="a">Acura</a></li>
<li><a href="#" data-theme="b">Audi</a></li>
<li><a href="#" data-theme="a">BMW</a></li>
<li><a href="#" data-theme="b">Cadillac</a></li>
<li><a href="#" data-theme="a">Ferrari</a></li>
</ul><!-- /content -->

My overall goal would be add external buttons from a search and then make them alternate colors automatically.

Exact link is at Jquery Mobile

Chris Rathjen
  • 11
  • 2
  • 2
  • 9
  • If you're using jQM 1.3 or before, you can use themes a to e. For jQm 1.4, only two themes are available a and b, and `data-role="button"` is deprecated. Which version are you using? – Omar Jan 03 '15 at 21:07
  • I am almost mint to jquery. I can let you know the prototype is being built on Notepad++ latest version. – Chris Rathjen Jan 03 '15 at 21:52
  • Thanks, but this is not helpful. Anyway, `console.log($.mobile.version);` or `alert()` it to know jQM version. – Omar Jan 03 '15 at 21:56
  • 1.2 is an obsolete version, use latest 1.4 – Omar Jan 04 '15 at 08:35
  • Hey, thanks for the comment. Could you send links for the min.js, mobile.min.js and the .js for 1.4? When I download from the website it doesn't find it in my directory. – Chris Rathjen Jan 04 '15 at 17:35
  • Omar, I am actually using a lot of your tutorials on pageContainter, rn from '13. – Chris Rathjen Jan 04 '15 at 17:42
  • http://jquerymobile.com/download/ Use CDN links or download files to host them yourself. – Omar Jan 04 '15 at 17:44
  • Question is then outdated and irrelevant then. No wonder, video game majors don't use textbooks. – Chris Rathjen Jan 04 '15 at 18:15
  • To be frank, your question isn't clear. Edit with clarification of what you want to achieve. Are you asking about themes, or how many times a button is clicked? – Omar Jan 04 '15 at 18:29

0 Answers0