最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Jquery mobile listview icons not showing correctly - Stack Overflow

matteradmin6PV0评论

I have a problem with the icons in a jquery mobile listview. As you can see in the picture below a question mark is showing after I've updated to the latest version of jquery mobile.

Icons not working correctly .png

Before I updated the question marks were like arrows to the right >.

My HTML:

<div data-role="content" data-theme="c">  
    <div id="status"></div>
    <ul id="linksList" data-role="listview" data-inset="true" data-theme="d" ></ul>
</div>

Javascript function for each row:

function renderEntries(entries) {
    var s = '';
    $.each(entries, function(i, v) {
        s += '<li><a href="#contentPage"  class="contentLink" data-entryid="'+i+'">' +                    v.title + '</a></li>';
    });
    $("#linksList").html(s);
    $("#linksList").listview("refresh");       
}

I've already tried adding data-icon="arrow-r" to the <li items but that didn't work. I've also updated the images map to their latest version.

UPDATE: I've copied this code from the JQM docs:

<ul data-role="listview" data-inset="true" data-theme="b">
    <li data-role="list-divider">Divider</li>
    <li data-icon="home"><a href="#">data-icon="home"</a></li>
    <li data-icon="delete"><a href="#">data-icon="delete"</a></li>
    <li data-icon="plus"><a href="#">data-icon="plus"</a></li>
    <li data-icon="arrow-u"><a href="#">data-icon="arrow-u"</a></li>
    <li data-icon="arrow-d"><a href="#">data-icon="arrow-d"</a></li>
    <li data-icon="check"><a href="#">data-icon="check"</a></li>
</ul>

After testing it i saw that the icons are actually showing BUT theres a question mark icon showing over them. Where does this question mark icon e from? And most importantly how do I get rid of it?

Any help is very appreciated!

Solved:

Seems like it that it was a bug. After updating to the latest JQM build 1.1.1, those question marks disappeared and everything works like it used to.

I have a problem with the icons in a jquery mobile listview. As you can see in the picture below a question mark is showing after I've updated to the latest version of jquery mobile.

Icons not working correctly http://jeflussenburg.nl/img/iconnotshowing.png

Before I updated the question marks were like arrows to the right >.

My HTML:

<div data-role="content" data-theme="c">  
    <div id="status"></div>
    <ul id="linksList" data-role="listview" data-inset="true" data-theme="d" ></ul>
</div>

Javascript function for each row:

function renderEntries(entries) {
    var s = '';
    $.each(entries, function(i, v) {
        s += '<li><a href="#contentPage"  class="contentLink" data-entryid="'+i+'">' +                    v.title + '</a></li>';
    });
    $("#linksList").html(s);
    $("#linksList").listview("refresh");       
}

I've already tried adding data-icon="arrow-r" to the <li items but that didn't work. I've also updated the images map to their latest version.

UPDATE: I've copied this code from the JQM docs:

<ul data-role="listview" data-inset="true" data-theme="b">
    <li data-role="list-divider">Divider</li>
    <li data-icon="home"><a href="#">data-icon="home"</a></li>
    <li data-icon="delete"><a href="#">data-icon="delete"</a></li>
    <li data-icon="plus"><a href="#">data-icon="plus"</a></li>
    <li data-icon="arrow-u"><a href="#">data-icon="arrow-u"</a></li>
    <li data-icon="arrow-d"><a href="#">data-icon="arrow-d"</a></li>
    <li data-icon="check"><a href="#">data-icon="check"</a></li>
</ul>

After testing it i saw that the icons are actually showing BUT theres a question mark icon showing over them. Where does this question mark icon e from? And most importantly how do I get rid of it?

Any help is very appreciated!

Solved:

Seems like it that it was a bug. After updating to the latest JQM build 1.1.1, those question marks disappeared and everything works like it used to.

Share Improve this question edited Jul 27, 2012 at 19:25 Jef asked Jul 27, 2012 at 14:06 JefJef 8111 gold badge18 silver badges36 bronze badges 1
  • 1 Just a suggestion: You can post an answer and mark that as the correct answer instead of appending a "solved:" section. – Calavoow Commented Sep 28, 2012 at 14:11
Add a ment  | 

3 Answers 3

Reset to default 2

A bit old now but this might help someone since I recently had the same issue. Looks like you were missing the images directory from inside www/css There should have been a folder www/css/images with these 5 images in it:

ajax-loader.gif     icons-18-white.png  icons-36-white.png icons-18-black.png   icons-36-black.png

The jquery full package zip (JavaScript, CSS, and images) has them in it.

You should add the data-icon="arrow-r" to the <a> items according to the documentation.

Seems like it that it was a bug. After updating to the latest JQM build 1.1.1, those question marks disappeared and everything works like it used to.

Post a comment

comment list (0)

  1. No comments so far