Bart De Kimpe
Bart De Kimpe

Reputation: 359

My list won't take the css in phonegap

I'm using phone gap and some jQuery mobile framework. I want to put some data into a list using the $.each function. I get the data, but the list won't take over the css.

When I just put static test in the ordered list like this:

<div class="gamelijst" >
                  <ol >
                      <li><p><em>The Netherlands</em> is a country in Northwestern Europe, constituting the major portion of the Kingdom of the Netherlands.</p></li>
                      <li><p><em>The United States of America</em> is a federal constitutional republic comprising fifty states and a federal district.</p></li>
                      <li><p><em>The Philippines</em> officially known as the Republic of the Philippines, is a country in Southeast Asia with Manila as its capital city.</p></li>
                      <li><p><em>The United Kingdom</em> of Great Britain and Northern Ireland is a sovereign state located off the northwestern coast of continental Europe.</p></li>
                  </ol>
              </div>

, it has got the perfect css but when I want to load something into it like this:

    function krijgSpellen(){


            $.each(jsonopgehaald.games, function(){
                   $(".gamelijst").append("<li><p><em>" + this.name + "</em> is a country in Northwestern Europe</p></li>"); //<a id=" + this.id + " href='' class='large button'>Play</a>
                   });

            //$(".gamelijst, $.mobile.activePage").listview('refresh');
        };


<div class="gamelijst" >
                  <ol >

                  </ol>
              </div>

It won't take the css, yes i've tried the $(".gamelijst, $.mobile.activePage").listview('refresh'); but that won't work.

Upvotes: 0

Views: 245

Answers (1)

kfuglsang
kfuglsang

Reputation: 2505

It looks as if you are appending the elements inside the <div> tag and not the <ol> (as in your static example).

Upvotes: 1

Related Questions