Icon micro-framework
JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 6 commits behind baldwindavid:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demo
.gitignore
README.markdown
icon.css
jquery.icon.js

README.markdown

jquery.icon.js

The intent of this tiny plugin is to easily and flexibly add icons beside your text, links, list items, etc. It is sort of a micro-framework for icons on your website.

Requirements

  • jquery (>1.4x)
  • jquery.icon.js
  • icon.css (or your custom css)

Super Simple Example

sample js...

<script type="text/javascript" charset="utf-8">
  $(function(){
    $(".example-class").icon();
  });
</script>

...and sample html

<a class="example-class" data-icon="facebook.gif">Link to Facebook</a>

Demo

The repo includes the demo files, but you can also view the demo at http://baldwindavid.github.com/jquery-icon/demo

Icon Sets

jquery.autoIcons.js

You might also find the jquery.autoIcons.js plugin helpful to automatically add icons to links based upon common file extensions (doc, xls, etc) or your own custom extensions.