我的列表不会采取css在phonegap [英] My list won't take the css in phonegap

查看:138
本文介绍了我的列表不会采取css在phonegap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用手机差距和一些jQuery移动框架。
我想使用$ .each函数将一些数据放入列表。我得到的数据,但列表不会接管css。

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>

,它有完美的CSS,但当我想加载东西到这样: p>

, 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>

它不会采取css,是的我试过$(。gamelijst,$ .mobile.activePage)。listview('refresh');但是这不会工作。

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

推荐答案

看起来像是在 ; div> 标记,而不是< ol> (如你的静态示例)。

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

这篇关于我的列表不会采取css在phonegap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆