Home
Manage Your Code
Snippet: highlight jquery extension (JavaScript)
Title: highlight jquery extension Language: JavaScript
Description: this wraps a object in a div with a background color and then fades it out and in still needs some work Views: 444
Author: Kevin Isom Date Added: 12/6/2007
Copy Code  
jQuery.fn.extend({

      //---------------------------------------------------------------

      highlight : function(speed, color, callback) {

            // Use FadeTo to avoid the 'display:none' of FadeOut
				return $(this).wrap("<div class='wrap' style='background:" + color + ";'></div>").
					fadeTo(speed, 0.01, function(){$(this).fadeTo(speed, 1.0, callback)});

      }
});