开发者

json and jcarousel li issue

I am pulling a json query and putting it into a jcarousel. Works fine 开发者_StackOverflowbut I have to add the exact number of li tags after the div to get it to display properly:

<script>
$.getJSON("http://myurl.com/s.json?&callback=?",   
function(data){        
        $.each(data.products, function(i,item){          
        $("#products").append("<li><a href='"+item.Url+"'>
    <kmg src='"+item.image+"'alt='' width='75' height='75' border='0'></a>"+"<br>"+item.Name+"<br>"+"$"+item.salePrice+"</li>");         

    });      
});  
</script>
<div id="container">
<div id="carousel" class="carousel module">
         <ul><div id="products"></div>
    <li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
         </ul>
    </div>

If I don't use the carousel the li s are there - any ideas?

Had to change the image tag to get this to post k is an i


Is this the code you have pasted from your original code?
if so you have mistaken <img /> tag with <kmg />

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜