Šo liekam pirms - :
Code
<style>
.imgwrap {padding:2px}
.cat_image {vertical-align:-4px}
</style>
<script>
var pic = ['http://icons.iconarchive.com/icons/creative-freedom/free-vibrant/16/Video-icon.png'];
var cats = 14; // число категорий
$(function () {
// By ujs.su;
for(i=0;i < cats+1; i++) {
var pics = pic[i] ? pic[i] : pic[0];
$('#cid'+i+'').find('a').before('<span class="imgwrap"><img class="cat_image" src="'+pics+'" border="0" /></span>')
}
})
</script>
Ja vēlamies katrai kategorijai savu iconu tad šo vietu labojam atdalot ar komatu:
Code
var pic = ['http://icons.iconarchive.com/icons/creative-freedom/free-vibrant/16/Video-icon.png'];
Piemērs:
Code
var pic = ['http://icons.iconarchive.com/icons/creative-freedom/free-vibrant/16/Video-icon.png' , 'http://icons.iconarchive.com/icons/creative-freedom/free-vibrant/16/Video-icon.png'];
Iznākums: