You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
1.1 KiB

(function($) {
//首页标准模块中间多图广告鼠标触及凸显
$.fn.jfade = function(settings) {
var defaults = {
start_opacity: "1",
high_opacity: "1",
low_opacity: ".1",
timing: "500"
};
var settings = $.extend(defaults, settings);
settings.element = $(this);
//set opacity to start
$(settings.element).css("opacity", settings.start_opacity);
//mouse over
$(settings.element).hover(
//mouse in
function() {
$(this).stop().animate({
opacity: settings.high_opacity
},
settings.timing); //100% opacity for hovered object
$(this).siblings().stop().animate({
opacity: settings.low_opacity
},
settings.timing); //dimmed opacity for other objects
},
//mouse out
function() {
$(this).stop().animate({
opacity: settings.start_opacity
},
settings.timing); //return hovered object to start opacity
$(this).siblings().stop().animate({
opacity: settings.start_opacity
},
settings.timing); // return other objects to start opacity
});
return this;
}
})(jQuery);