开发者

wrap li elements in a loop

i have this piece of code that I am trying to scroll using the jQuery scroller plugin.

<ul>
<li style="margin-left:2px;"><span><?php echo a ?></span></li>
<li style="margin-left:2px;"><span><?php echo b ?></span></li>
<li style="margin-left:2px;"><span><?php echo $arrow?></span></li>              
<li style="margin-left:2px;"><span><?php echo c ?></span></li>
<li style="margin-l开发者_如何学编程eft:2px;"><span><?php echo d ?>&nbsp;&nbsp;&nbsp;</span></li>
</ul>

I am trying to get the li elements in the sequence..

a b c d a1 b1 c1 d1 a2 b2 c2 d2 ... so on...where

a1 - stands for ajax refreshed a.

any ideas on how to implement this?


TRY

var listValue = jQuery('ul').children().map( function() {
        return jQuery(this).text();
    }).get();
alert(listValue);

DEMO

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜