, .live(), - , .live() docs:
DOM .live(). , .live() , .
.live() jQuery, DOM, .selector , , , .live, :
jQuery.fn.sb_animateMenuItem = function() {
$(this.selector).live(.....)
, .live()? , , , ( , )... $(DOMElement).live(), , ?
, , uuid, , , .bind(), , .live() .
:. , , , .live() .bind() , , .live() :
jQuery.fn.sb_animateMenuItem = function() {
var mousehoverColor = '#0089F7';
var duration = 250;
var method = this.selector ? jQuery.fn.live : jQuery.fn.bind;
method.apply(this, ['mouseover', function() {
if(!jQuery.data(this, 'oColor'))
jQuery.data(this, 'oColor', jQuery(this).css('background-color'));
jQuery(this).stop(true).animate({ backgroundColor:mousehoverColor }, duration);
}]);
method.apply(this, ['mouseout', function() {
jQuery(this).animate({ backgroundColor:jQuery.data(this, 'oColor') }, duration);
}]);
return this.css('cursor', 'pointer');
};
, .