I need list of all class name of Font-Awesome

前端 未结 18 2892
傲寒
傲寒 2020-12-12 13:44

I build app that will present a lot of icons so I need list of all Font-Awesome class name like [\"fa-dropbox\",\"fa-rocket\",\"fa-globe\", ....] so on is ther

18条回答
  •  囚心锁ツ
    2020-12-12 14:17

    In case someone would like to have Font awesome icons grouped just like in http://fontawesome.io/icons/. Paste this to JS console on icons screen of FA.

    var allIcons = {};
    $('#icons section:not(#new):not(#spinner)').each(function(key, item) {
        var name = $(item).attr('id');
        allIcons[name] = [];
        $(item).find('div a i').each(function(iconKey, icon) {
            allIcons[name].push($(icon).attr('class').substring(3));
        })
    });
    

提交回复
热议问题