views:

90

answers:

1

i want after i shuffle a list 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);
A: 
$('ul').shuffle(); //this will shuffle the list

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


$.operation(a, shuffle);
Ben
Just a side note, `var a = [];` does the same thing as `var a = new Array();`
Matt Huggins