开发者

after shuffle a list get array with jquery

开发者 https://www.devze.com 2022-12-28 12:06 出处:网络
i want after i shuffle a lis开发者_Go百科t of images to get all the alt=\"\" value in one array!

i want after i shuffle a lis开发者_Go百科t of images to get all the alt="" value in one array! but i get always the save value!why?

$('ul').shuffle(); //this will shuffle the list

var a = {};
$("ul img").each(function() {
  a[this.alt] = $(this).attr("alt");
});


$.operation(a, shuffle);


$('ul').shuffle(); //this will shuffle the list

var a = new Array();
$("ul > img").each(function(i) {
  a[i] = $(this).attr("alt");
});


$.operation(a, shuffle);
0

精彩评论

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