The intent of this tiny plugin is to automatically add icons to links matching common extensions (pdf, doc, xls, etc.). You can also easily add your own custom mappings.
- jquery
- jquery.autoIcons.js
- icon.css (or your custom css)
<script type="text/javascript" charset="utf-8">
$(function(){
$("#main-content").autoIcons();
});
</script>
<div id="main-content">
<a href="somefile.doc">Link to Some Word doc</a>
</div>
The repo includes the demo files, but you can also view the demo at http://baldwindavid.github.com/jquery-autoIcons/demo
Any icon set can be made to work with this plugin, but the examples in the demo are from the Doctype Icons 2 set
You might also find the jquery.icon.js icon micro-framework plugin helpful.