Reputation: 17
Hi i'm using jquery mobile and i'm adding <li>
to <ul>
but i don t get why it doesn t work,<li>
not adding well i followed this http://jsfiddle.net/Gajotres/HuKab/
looks like the problem comes from the div
Code:
for (i = 0; i < 2; i++) {
var htmlText = '<li><div style="float:left"><br/><img src="images/steto.png" alt="image" /></div><div style="float:right"><br/><strong>'+i+' aaaaaaaa </strong><p> '+i+' zzzzzzz : '+i+' zzzzzzzzz<br/> zzzzzzz : <br/> '+i+' RPPS : '+i+' zzzzzzzz </p></div></li>';
$('ul').append(htmlText);
}
$('ul').listview('refresh');
An image http://hpics.li/b00407e
P.S. : when i do that in html directly it works fine and when i just had one it's work and place well thanks for help sry for english
Upvotes: 0
Views: 1268
Reputation: 348
Add trigger( "create" ) with the $('ul').append(htmlText) as follow:
$('ul').append(htmlText).trigger( "create" );
hope it will work.
Upvotes: 1