Jquery组件封装之鼠标移入移出图片透明度变化

(function($){
$.fn.jfade=function(settings){
var defaults={
start_opacity:"1",
hign_opacity:"1",
low_opacity:".1",
timing:"500"
};
var settings=$.extends(defaults,settings);
var settings.element=$(this);

$(settings.element).css("opacity",settiings.start_opacity);
$(settings.element).hover(
function(){
$(this).stop().animate({
opacity:settings.hign_opacity
},settings.timing);
$(this).siblings().stop.animate({
opacity:settings.low_opacity
},settings.timing);
},
function(){
$(this).stop().animate({
opacity:settings.start_opacity
},settings.timing);
$(this).siblings().stop().animate({
opaciity:settings.start_opacity
},settings.timing);
}
);
return this;
}
})(jQuery)

你可能感兴趣的:(js)