Posted By

iTony on 10/18/08


Tagged

jquery links fade


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

sulfurito


Fadint links to another color


 / Published in: JavaScript
 

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

  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. });

Report this snippet  

You need to login to post a comment.