Skip to content

Instantly share code, notes, and snippets.

@apsolut
Created July 30, 2016 17:24
Show Gist options
  • Save apsolut/d2898ecb846cae3d6c202fcaa801207e to your computer and use it in GitHub Desktop.
Save apsolut/d2898ecb846cae3d6c202fcaa801207e to your computer and use it in GitHub Desktop.
get_image_div_class_each
var getallimages = '';
var Icons = {};
jQuery('#voc_fullstage_img #voc_ext_pics').find('.voc_Stage').each(function(index) {
var text = jQuery(this).find('img').attr('src');
if (text.indexOf('(alias)') === -1) {
Icons[text.trim()] = text.trim().split('-').join(' ');
}
});
var keys = Object.keys(Icons),
i, len = keys.length,
kicon, ktext = '';
keys.sort();
for (i = 0; i < len; i++) {
kicon = [i];
ktext = keys[kicon];
getallimages += "\t'" + kicon + '\'\t => \'' + ktext + '\',\n';
}
getallimages = '$icons = array(\n' + getallimages + ');\n';
console.info(getallimages);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment