Fadint links to another color


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /* plugin */
  2. jQuery.fn.dwFadingLinks = function(settings) {
  3. settings = jQuery.extend({
  4. color: '#ff8c00',
  5. duration: 500
  6. }, settings);
  7. return this.each(function() {
  8. var original = $(this).css('color');
  9. $(this).mouseover(function() { $(this).animate({ color: settings.color },settings.duration); });
  10. $(this).mouseout(function() { $(this).animate({ color: original },settings.duration); });
  11. });
  12. };
  13.  
  14. /* usage */
  15. $(document).ready(function() {
  16. $('.fade').dwFadingLinks({
  17. color: '#008000',
  18. duration: 700
  19. });
  20. });

URL: http://davidwalsh.name/fading-links-jquery-dwfadinglinks

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.