这里是我到目前为止追加列表元素中多次变基础
var count_element = $('div.wp-playlist-item > li').length;
totalcount = 10 - count_element;
if (totalcount > 1) {
$('div.wp-playlist-item').append('<li class="wp-playlist-caption"><div title="" data-original-title="" data-toggle="tooltip" data-title="0:00" data-placement="left" class="next-songs"><span class="wp-playlist-item-title">Blank</span></div></li>');
}
基本上我试图让这个div.wp-playlist-item
总是有10个列表元素。
所以,除非totalcount
= 0(10 - 10),追加这个列表元素。
在我目前的测试环境中,totalcount
等于8,所以我们想要触发我们的append命令8次。
我目前的代码正常工作只发射一次正确的追加。
哇超级简单。认为它会比这更复杂。谢谢你,你是第一个。还为演示+1。 – bbruman