Skip to content

christianvuerings/jquery-favicons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jQuery Favicons Plug-in

Add favicons to anchor elements on your page.

Feel free to check out the examples.

Preview of the plug-in

Requirements

Usage

<script src="https://cdn.rawgit.com/christianv/jquery-favicons/gh-pages/jquery.favicons.min.js"></script>
<script>
  $('a[href^="http://"]').favicons();
</script>

You can download the complete or minified version of the script locally. You're also able to change the jQuery selector a[href^="http://"] to whatever you want.

Configuration

The plug-in accepts 1 argument, which is the config object.

$('a').favicons({
  'classname': 'sakai-favicon',
  'service': 'http://g.etfv.co/__URL__?defaulticon=http://www.google.com/favicon.ico'
});
  • classname: Name of the CSS class (default: "favicon")

  • service: URL of the service you want to use. (default: "http://g.etfv.co/\_\_URL\_\_")

    • __URL__ will be replaced by the complete URL.
    • __DOMAIN__ will be replaced by the domain, which is the URL without http:// or https://.

Features

  • Chainable
$('a').favicons().css('color', '#ff0000');
  • Different services
$('a').favicons({
  'service': 'http://www.getfavicon.org/?url=__DOMAIN__'
});
  • Change default icon
$('a').favicons({
  'service': 'http://g.etfv.co/__URL__?defaulticon=http://www.google.com/favicon.ico'
});

Sites

Sites using this plug-in. Feel free to fork the project and send a pull request to add your site in here.

Inspiration

About

Add favicons to anchor elements on your page

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published