1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| function Abc(){ var abc = Array(); jQuery('.pro_list .pro_data.sho.sho1.sho2.sho3.sho4.sho5.sho6.sho7.sho8.sho9.sho10.sho11.sho12.sho13.sho14.sho15.sho16.sho17.sho18.sho19.sho20').each(function(index, element) { var cont = jQuery('.pro_list .pro_data.sho.sho1.sho2.sho3.sho4.sho5.sho6.sho7.sho8.sho9.sho10.sho11.sho12.sho13.sho14.sho15.sho16.sho17.sho18.sho19.sho20:eq(' + index + ')').html(); var p_title = jQuery('.pro_list .pro_data.sho.sho1.sho2.sho3.sho4.sho5.sho6.sho7.sho8.sho9.sho10.sho11.sho12.sho13.sho14.sho15.sho16.sho17.sho18.sho19.sho20:eq(' + index + ') .pro_name').text(); abc[p_title] = cont; }); var keys = Object.keys(abc).sort(); jQuery(".pro_list .pro_data.sho.sho1.sho2.sho3.sho4.sho5.sho6.sho7.sho8.sho9.sho10.sho11.sho12.sho13.sho14.sho15.sho16.sho17.sho18.sho19.sho20").empty(); jQuery.each(keys, function(i, key){ console.log(abc[i]); jQuery('.pro_list .pro_data.sho.sho1.sho2.sho3.sho4.sho5.sho6.sho7.sho8.sho9.sho10.sho11.sho12.sho13.sho14.sho15.sho16.sho17.sho18.sho19.sho20:eq(' + i + ')').append(abc[key]); }); }
|